configuration.nix/home/programs/neovim.nix

175 lines
4.1 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;
2023-09-10 16:04:45 +05:30
colorschemes.dracula = {
enable = true;
fullSpecialAttrsSupport = true;
};
2023-08-06 22:46:58 +05:30
extraPackages = with pkgs; [
fd
ripgrep
];
2023-08-20 12:19:51 +05:30
extraConfigLuaPre = ''
vim.opt.listchars:append "space:"
vim.opt.listchars:append "eol:"
'';
2023-08-05 17:42:16 +05:30
options = {
autowrite = true;
background = "dark";
clipboard = "unnamedplus";
expandtab = true;
laststatus = 2;
2023-08-20 12:19:51 +05:30
list = true;
2023-08-05 17:42:16 +05:30
number = true;
relativenumber = true;
shiftwidth = 2;
2023-08-20 12:19:34 +05:30
showmode = false;
2023-08-05 17:42:16 +05:30
signcolumn = "yes";
smartindent = true;
2023-08-20 12:19:34 +05:30
splitbelow = true;
splitright = true;
swapfile = false;
2023-08-05 17:42:16 +05:30
tabstop = 2;
termguicolors = true;
updatetime = 100;
wrap = 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
};
2023-08-14 19:54:18 +05:30
"<leader>`" = {
silent = true;
action = "<cmd>:ToggleTerm<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>";
};
2023-08-06 22:46:58 +05:30
"<leader>ff" = {
silent = true;
action = "<cmd>:Telescope find_files<Return>";
};
"<leader>fg" = {
silent = true;
action = "<cmd>:Telescope live_grep<Return>";
};
2023-08-06 11:25:35 +05:30
};
};
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-09-16 17:39:35 +05:30
gitblame = {
enable = true;
dateFormat = "%r";
};
2023-08-20 12:19:02 +05:30
gitsigns.enable = true;
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-14 19:54:36 +05:30
lsp = {
enable = true;
servers = {
bashls.enable = true;
2023-09-14 21:35:20 +05:30
dartls.enable = true;
2023-08-14 19:54:36 +05:30
gopls.enable = true;
jsonls.enable = true;
nixd.enable = true;
rust-analyzer.enable = true;
yamlls.enable = true;
};
};
lualine = {
enable = true;
globalstatus = true;
theme = "dracula";
};
2023-08-06 11:25:35 +05:30
neo-tree = {
enable = true;
addBlankLineAtTop = true;
enableDiagnostics = true;
enableGitStatus = true;
2023-08-20 12:50:48 +05:30
closeIfLastWindow = false;
2023-08-06 11:25:35 +05:30
filesystem = {
2023-08-09 22:45:44 +05:30
followCurrentFile = {
enabled = true;
leaveDirsOpen = false;
};
2023-08-28 19:24:00 +05:30
filteredItems.visible = true;
2023-08-06 11:25:35 +05:30
useLibuvFileWatcher = true;
2023-08-05 17:42:16 +05:30
};
};
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 22:46:58 +05:30
telescope = {
enable = true;
extensions = {
fzf-native = {
enable = true;
caseMode = "smart_case";
fuzzy = true;
};
};
};
2023-08-14 19:54:18 +05:30
toggleterm = {
enable = true;
};
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
};
}