Compare commits

..

5 commits

Author SHA1 Message Date
4ca6e49b9f
fix: oops what did i do here? 2024-06-29 00:46:31 +02:00
d844457305
fix: neotree border solid 2024-05-31 19:28:57 +02:00
f5bd91045d
feat: use rustaceanvim ratheer than rust-tools
also inlay hint fixes
2024-05-31 18:09:45 +02:00
188bb40227
fix: ruby_ls -> ruby_lsp 2024-05-15 18:49:43 +02:00
6d84567a5e
feat: configure go lsp too 2024-05-15 18:49:35 +02:00
3 changed files with 19 additions and 30 deletions

View file

@ -161,6 +161,7 @@ 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

View file

@ -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,12 +80,13 @@ 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>i', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<leader>R', 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)
@ -93,6 +94,7 @@ 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',

View file

@ -15,10 +15,10 @@
PPPPPPPPPPPPGBPG&&& &&&&&&###BBBGGGGGGGBB##&& - pickers: telescope.nvim
&BGPPPPPPPPPPPPPPGGGGGGGGGGGGGGGGGGGBBB##&&& - files: neo-tree.nvim
&&##BBBBGGGGGGGPGBBBBBB####&&&& - git: vim-fugitive + gitsigns.nvim
&#B#& - extra: hexmode, vim-combo,
&& ###& rust-tools, nvim-colorizer,
&G# &&#&&& nvim-jdtls, vim-surround,
&&& undotree,
&#B#& - extra: hexmode, vim-surround,
&& ###& undotree, nvim-colorizer,
&G# &&#&&& nvim-jdtls, rustaceanvim,
&&& vim-combo,
]]--
local function set_lsp_binds(_, bufnr)
@ -96,6 +96,7 @@ return {
config = function ()
vim.g.neo_tree_remove_legacy_commands = 1
require('neo-tree').setup({
popup_border_style = "solid",
sources = {
"filesystem",
"buffers",
@ -156,32 +157,16 @@ return {
},
{
'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" },
},
'mrcjkb/rustaceanvim',
init = function ()
vim.g.rustaceanvim = {
server = {
capabilities = capabilities,
capabilites = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()),
on_attach = set_lsp_binds,
settings = {
['rust-analyzer'] = {
checkOnSave = { command = "clippy" },
}
}
},
dap = { adapter = require('dap').adapters.lldb },
})
rust_tools.inlay_hints.enable()
end
}
end,
lazy = false,
},
{
@ -206,8 +191,9 @@ 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_ls.setup({capabilities=capabilities, on_attach=set_lsp_binds})
lspconfig.ruby_lsp.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})