configuration.nix/home/programs/neovim.nix

139 lines
3.3 KiB
Nix
Raw Normal View History

2023-05-27 21:11:38 +05:30
{pkgs, ...}: {
2023-08-05 17:50:01 +05:30
xdg.desktopEntries = {
"nvim".name = "Neovim wrapper";
"nvim".exec = "nvim %F";
"nvim".noDisplay = true;
};
2023-08-05 17:42:16 +05:30
programs.nixvim = {
enable = true;
2023-06-04 10:20:19 +05:30
viAlias = true;
vimAlias = true;
2023-08-05 17:42:16 +05:30
clipboard.providers.wl-copy.enable = true;
colorscheme = "dracula";
extraPlugins = with pkgs.vimPlugins; [
2023-08-06 11:26:16 +05:30
dracula-vim
2023-06-04 10:20:19 +05:30
];
2023-08-05 17:42:16 +05:30
options = {
autowrite = true;
background = "dark";
clipboard = "unnamedplus";
expandtab = true;
laststatus = 2;
showmode = false;
swapfile = false;
number = true;
relativenumber = true;
shiftwidth = 2;
signcolumn = "yes";
smartindent = true;
tabstop = 2;
termguicolors = true;
updatetime = 100;
wrap = true;
splitright = true;
splitbelow = true;
};
maps = {
normal = {
"<C-a>" = {
silent = true;
action = "<cmd>bp<Return>";
};
"<C-d>" = {
silent = true;
action = "<cmd>bn<Return>";
};
"<C-h>" = {
silent = true;
action = "<cmd>noh<Return>";
};
"<leader>w" = {
2023-08-06 18:47:47 +05:30
silent = true;
action = "<cmd>bdelete<Return><cmd>bnext<Return>";
2023-08-06 11:25:35 +05:30
};
"<leader>1" = {
2023-08-06 18:47:47 +05:30
silent = true;
2023-08-06 11:25:35 +05:30
action = "<cmd>:Neotree toggle<Return>";
};
};
};
plugins = {
2023-08-06 11:25:55 +05:30
bufferline = {
enable = true;
diagnostics = "nvim_lsp";
offsets = [
{
filetype = "neo-tree";
text = "File Explorer";
separator = true;
}
];
separatorStyle = "slant";
};
2023-08-06 19:34:00 +05:30
cmp-buffer.enable = true;
cmp-nvim-lsp.enable = true;
cmp-nvim-lsp-document-symbol.enable = true;
cmp-nvim-lsp-signature-help.enable = true;
cmp-treesitter.enable = true;
cmp_luasnip.enable = true;
2023-08-06 12:02:57 +05:30
gitsigns = {
enable = true;
2023-08-06 18:50:05 +05:30
currentLineBlame = true;
currentLineBlameOpts.delay = 100;
2023-08-06 12:02:57 +05:30
};
2023-08-06 18:50:28 +05:30
indent-blankline = {
enable = true;
showEndOfLine = true;
useTreesitter = true;
useTreesitterScope = true;
};
2023-08-06 19:34:33 +05:30
lastplace.enable = true;
2023-08-06 11:25:35 +05:30
neo-tree = {
enable = true;
addBlankLineAtTop = true;
enableDiagnostics = true;
enableGitStatus = true;
closeIfLastWindow = true;
buffers = {
followCurrentFile = true;
};
filesystem = {
followCurrentFile = true;
useLibuvFileWatcher = true;
2023-08-05 17:42:16 +05:30
};
};
2023-08-06 18:50:56 +05:30
lsp = {
enable = true;
servers = {
2023-08-06 19:34:14 +05:30
bashls.enable = true;
gopls.enable = true;
jsonls.enable = true;
2023-08-06 18:50:56 +05:30
nixd.enable = true;
2023-08-06 19:34:14 +05:30
rust-analyzer.enable = true;
yamlls.enable = true;
2023-08-06 18:50:56 +05:30
};
};
2023-08-06 11:26:25 +05:30
lualine = {
enable = true;
globalstatus = true;
theme = "dracula";
};
2023-08-06 19:34:00 +05:30
nvim-cmp = {
enable = true;
2023-08-06 19:45:20 +05:30
snippet.expand = "luasnip";
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
{name = "buffers";}
{name = "treesitter";}
];
2023-08-06 19:34:00 +05:30
};
2023-08-06 18:51:04 +05:30
treesitter = {
enable = true;
};
treesitter-context.enable = true;
treesitter-refactor.enable = true;
2023-08-05 17:42:16 +05:30
};
2023-05-27 17:07:47 +05:30
};
}