Skip to content

Commit

Permalink
📝 improve neovim setup
Browse files Browse the repository at this point in the history
  • Loading branch information
nimueller committed Jan 13, 2024
1 parent e1dec4a commit 8abf632
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/nvim/lua/plugins/editor.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
return {
-- Non-LSP linters
'jose-elias-alvarez/null-ls.nvim',
-- Non-LSP linters and formatters
'nvimtools/none-ls.nvim',

-- Easily surround text
{
Expand Down
13 changes: 12 additions & 1 deletion config/nvim/lua/settings/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local servers = {
bashls = {},
texlab = {},
ltex = {},
kotlin_language_server = {}
}

local on_attach = function(_, bufnr)
Expand All @@ -27,7 +28,8 @@ local on_attach = function(_, bufnr)
end

nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('<leader>cr', vim.lsp.buf.format, '[C]ode [R]eformat')
nmap('<leader>cf', vim.lsp.buf.format, '[C]ode [F]ormat')
nmap('<leader>cr', vim.lsp.buf.rename, '[C]ode [R]ename')

nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
Expand Down Expand Up @@ -61,3 +63,12 @@ for server_name, config in pairs(servers) do
settings = config,
}
end

local null_ls = require'null-ls'
null_ls.setup({
sources = {
null_ls.builtins.diagnostics.ktlint,
null_ls.builtins.formatting.ktlint
}
})

4 changes: 4 additions & 0 deletions home-manager/headless/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# Nix
nixd

# Kotlin
kotlin-language-server
ktlint

# LaTeX
texliveFull
evince
Expand Down

0 comments on commit 8abf632

Please sign in to comment.