Last active
June 18, 2024 14:09
-
-
Save GaetanLepage/5e74c97ebe83a880f22cd2186fcb053c to your computer and use it in GitHub Desktop.
Example of a nixvim configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
programs.nixvim = { | |
enable = true; | |
vimAlias = true; | |
# Configure neovim options... | |
options = { | |
relativenumber = true; | |
incsearch = true; | |
}; | |
# ...mappings... | |
maps = { | |
normal = { | |
"<C-s>" = ":w<CR>"; | |
"<esc>" = { action = ":noh<CR>"; silent = true; }; | |
}; | |
visual = { | |
">" = ">gv"; | |
"<" = "<gv"; | |
}; | |
}; | |
# ...plugins... | |
plugins = { | |
telescope.enable = true; | |
harpoon = { # Hi Prime :) | |
enable = true; | |
keymaps.addFile = "<leader>a"; | |
}; | |
lsp = { | |
keymaps = { | |
silent = true; | |
diagnostic = { | |
"<leader>k" = "goto_prev"; | |
"<leader>j" = "goto_next"; | |
}; | |
lspBuf = { | |
gd = "definition"; | |
K = "hover"; | |
}; | |
}; | |
servers = { | |
bashls.enable = true; | |
clangd.enable = true; | |
nil_ls.enable = true; | |
}; | |
}; | |
}; | |
# ... and even highlights and autocommands ! | |
highlight.ExtraWhitespace.bg = "red"; | |
match.ExtraWhitespace = "\\s\\+$"; | |
autoCmd = [ | |
{ | |
event = "FileType"; | |
pattern = "nix"; | |
command = "setlocal tabstop=2 shiftwidth=2"; | |
} | |
]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment