Compare commits
No commits in common. "4ca6e49b9f3e8386d15dfbaaadcd36521462bb8a" and "3aa178165c1c054c14a2c762c1063c299c8563f7" have entirely different histories.
4ca6e49b9f
...
3aa178165c
3 changed files with 32 additions and 21 deletions
1
init.lua
1
init.lua
|
@ -161,7 +161,6 @@ require('lazy').setup(PLUGINS)
|
|||
--|| THEME
|
||||
vim.cmd("colorscheme peak") -- TODO can I do it in lua?
|
||||
|
||||
vim.lsp.inlay_hint.enable(true) -- default on
|
||||
|
||||
--|| UTILITY
|
||||
function P(something) print(vim.inspect(something)) end
|
||||
|
|
|
@ -45,7 +45,7 @@ function KEYBINDS:set_global_keys(opts)
|
|||
vim.keymap.set('n', '<C-t>', ':Neotree toggle<CR>', {noremap=true})
|
||||
vim.keymap.set('n', '<C-S-t>', ':Neotree toggle source=symbolmap right<CR>', {noremap=true})
|
||||
vim.keymap.set('n', '<C-PageUp>', ':Neotree toggle source=diagnostics bottom<CR>', opts)
|
||||
-- vim.keymap.set('n', '<C-h>', vim.cmd.UndotreeToggle, {noremap=true})
|
||||
vim.keymap.set('n', '<C-h>', vim.cmd.UndotreeToggle, {noremap=true})
|
||||
-- Esc goes back to normal mode in terminal
|
||||
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>', opts)
|
||||
|
||||
|
@ -80,13 +80,12 @@ function KEYBINDS:set_lsp_keys(opts)
|
|||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', '<leader>d', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', '<leader>y', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<leader>R', vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set('n', '<leader>i', vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set('n', '<leader>r', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', '<leader>h', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<leader>f', vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set('n', '<C-Space>', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<C-x>', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<leader>H', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end)
|
||||
-- vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
-- vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<M-r>', vim.lsp.buf.rename, opts)
|
||||
|
@ -94,7 +93,6 @@ function KEYBINDS:set_lsp_keys(opts)
|
|||
vim.keymap.set('n', '<leader><Del>', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '<C-Del>', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '<M-x>', vim.diagnostic.open_float, opts) -- fallback for windows
|
||||
vim.keymap.set('n', '<C-h>', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end)
|
||||
-- It's not really a keybind but whatever
|
||||
vim.api.nvim_create_user_command(
|
||||
'Format',
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
PPPPPPPPPPPPGBPG&&& &&&&&&###BBBGGGGGGGBB##&& - pickers: telescope.nvim
|
||||
&BGPPPPPPPPPPPPPPGGGGGGGGGGGGGGGGGGGBBB##&&& - files: neo-tree.nvim
|
||||
&&##BBBBGGGGGGGPGBBBBBB####&&&& - git: vim-fugitive + gitsigns.nvim
|
||||
&#B#& - extra: hexmode, vim-surround,
|
||||
&& ###& undotree, nvim-colorizer,
|
||||
&G# &&#&&& nvim-jdtls, rustaceanvim,
|
||||
&&& vim-combo,
|
||||
&#B#& - extra: hexmode, vim-combo,
|
||||
&& ###& rust-tools, nvim-colorizer,
|
||||
&G# &&#&&& nvim-jdtls, vim-surround,
|
||||
&&& undotree,
|
||||
]]--
|
||||
|
||||
local function set_lsp_binds(_, bufnr)
|
||||
|
@ -96,7 +96,6 @@ return {
|
|||
config = function ()
|
||||
vim.g.neo_tree_remove_legacy_commands = 1
|
||||
require('neo-tree').setup({
|
||||
popup_border_style = "solid",
|
||||
sources = {
|
||||
"filesystem",
|
||||
"buffers",
|
||||
|
@ -157,16 +156,32 @@ return {
|
|||
},
|
||||
|
||||
{
|
||||
'mrcjkb/rustaceanvim',
|
||||
init = function ()
|
||||
vim.g.rustaceanvim = {
|
||||
server = {
|
||||
capabilites = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||
on_attach = set_lsp_binds,
|
||||
'simrat39/rust-tools.nvim', -- extra LSP defaults for rust
|
||||
dependencies = {
|
||||
'hrsh7th/nvim-cmp', -- referenced here to guarantee load order
|
||||
},
|
||||
config = function ()
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
local rust_tools = require("rust-tools")
|
||||
rust_tools.setup({
|
||||
tools = {
|
||||
inlay_hints = { auto = true, highlight = "InlayHint" },
|
||||
hover_actions = { border = "none" },
|
||||
},
|
||||
}
|
||||
end,
|
||||
lazy = false,
|
||||
server = {
|
||||
capabilities = capabilities,
|
||||
on_attach = set_lsp_binds,
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
checkOnSave = { command = "clippy" },
|
||||
}
|
||||
}
|
||||
},
|
||||
dap = { adapter = require('dap').adapters.lldb },
|
||||
})
|
||||
rust_tools.inlay_hints.enable()
|
||||
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -191,9 +206,8 @@ return {
|
|||
lspconfig.bufls.setup({capabilities=capabilities, on_attach=set_lsp_binds})
|
||||
lspconfig.tsserver.setup({capabilities=capabilities, on_attach=set_lsp_binds})
|
||||
lspconfig.html.setup({capabilities=capabilities, on_attach=set_lsp_binds})
|
||||
lspconfig.ruby_lsp.setup({capabilities=capabilities, on_attach=set_lsp_binds})
|
||||
lspconfig.ruby_ls.setup({capabilities=capabilities, on_attach=set_lsp_binds})
|
||||
lspconfig.elixirls.setup({capabilites=capabilities, on_attach=set_lsp_binds, cmd= {"/usr/bin/elixir-ls"}})
|
||||
lspconfig.gopls.setup({capabilities=capabilities, on_attach=set_lsp_binds})
|
||||
-- lspconfig.rust_analyzer.setup({capabilities=capabilities, on_attach=set_lsp_binds, settings = { ['rust-analyzer'] = { checkOnSave = { command = "clippy"}}}})
|
||||
-- lspconfig.java_language_server.setup({capabilities=capabilities, on_attach=set_lsp_binds, cmd = { '/home/alemi/dev/software/java-language-server/dist/lang_server_linux.sh' }})
|
||||
-- lspconfig.kotlin_language_server.setup({capabilities=capabilities, on_attach=set_lsp_binds})
|
||||
|
|
Loading…
Reference in a new issue