NixVim config 1.0
This commit is contained in:
@ -23,12 +23,22 @@ in {
|
|||||||
(pkgs.ripgrep.override {withPCRE2 = true;})
|
(pkgs.ripgrep.override {withPCRE2 = true;})
|
||||||
|
|
||||||
# Linters
|
# Linters
|
||||||
vale
|
clippy # rust
|
||||||
|
checkstyle # java
|
||||||
|
clj-kondo # clojure
|
||||||
|
eslint_d # javascript
|
||||||
|
python312Packages.flake8
|
||||||
|
vale # text
|
||||||
|
statix # nix
|
||||||
|
|
||||||
# Formatters
|
# Formatters
|
||||||
alejandra # nix
|
alejandra # nix
|
||||||
|
google-java-format
|
||||||
|
html-tidy
|
||||||
jq # json
|
jq # json
|
||||||
html-tidy # html
|
prettierd # html/css/js
|
||||||
|
# rustfmt
|
||||||
|
# clang-tools
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
@ -51,7 +61,7 @@ in {
|
|||||||
hidden = true; # Don't unload buffers immediately
|
hidden = true; # Don't unload buffers immediately
|
||||||
mouse = "a";
|
mouse = "a";
|
||||||
completeopt = ["menuone" "noselect" "noinsert"];
|
completeopt = ["menuone" "noselect" "noinsert"];
|
||||||
timeoutlen = 100;
|
timeoutlen = 50;
|
||||||
pumheight = 0;
|
pumheight = 0;
|
||||||
formatexpr = "v:lua.require'conform'.formatexpr()";
|
formatexpr = "v:lua.require'conform'.formatexpr()";
|
||||||
laststatus = 3;
|
laststatus = 3;
|
||||||
@ -69,6 +79,8 @@ in {
|
|||||||
foldlevel = 99;
|
foldlevel = 99;
|
||||||
foldlevelstart = 99;
|
foldlevelstart = 99;
|
||||||
foldenable = true;
|
foldenable = true;
|
||||||
|
# foldmethod = "expr";
|
||||||
|
# foldexpr = "nvim_treesitter#foldexpr()";
|
||||||
|
|
||||||
# Files
|
# Files
|
||||||
encoding = "utf-8";
|
encoding = "utf-8";
|
||||||
@ -88,8 +100,8 @@ in {
|
|||||||
grepformat = "%f:%l:%c:%m";
|
grepformat = "%f:%l:%c:%m";
|
||||||
|
|
||||||
# Indentation
|
# Indentation
|
||||||
autoindent = false; # Might mess up comment indentation
|
autoindent = false; # Use previous line indentation level - Might mess up comment indentation
|
||||||
smartindent = false; # Might mess up comment indentation
|
smartindent = false; # Like autoindent but recognizes some C syntax - Might mess up comment indentation
|
||||||
cindent = true;
|
cindent = true;
|
||||||
cinkeys = "0{,0},0),0],:,!^F,o,O,e"; # Fix comment (#) indentation and intellitab (somehow)
|
cinkeys = "0{,0},0),0],:,!^F,o,O,e"; # Fix comment (#) indentation and intellitab (somehow)
|
||||||
smarttab = true;
|
smarttab = true;
|
||||||
@ -102,8 +114,8 @@ in {
|
|||||||
splitright = true;
|
splitright = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Use conform-nvim.formatOnSave, also make this toggleable and add a "Format" command
|
|
||||||
# TODO: Half of the neovide config doesn't work
|
# TODO: Half of the neovide config doesn't work
|
||||||
|
# TODO: LSP Window doesn't work. Noice?
|
||||||
extraConfigLua = ''
|
extraConfigLua = ''
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
local g = vim.g
|
local g = vim.g
|
||||||
@ -111,7 +123,6 @@ in {
|
|||||||
|
|
||||||
-- Neovide
|
-- Neovide
|
||||||
if g.neovide then
|
if g.neovide then
|
||||||
-- Neovide options
|
|
||||||
g.neovide_fullscreen = false
|
g.neovide_fullscreen = false
|
||||||
g.neovide_hide_mouse_when_typing = false
|
g.neovide_hide_mouse_when_typing = false
|
||||||
g.neovide_refresh_rate = 144
|
g.neovide_refresh_rate = 144
|
||||||
@ -127,6 +138,19 @@ in {
|
|||||||
-- Neovide Fonts
|
-- Neovide Fonts
|
||||||
o.guifont = "JetBrainsMono Nerd Font:h13:Medium:i"
|
o.guifont = "JetBrainsMono Nerd Font:h13:Medium:i"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Hide inline diagnostics
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Allow navigating popupmenu completion with Up/Down
|
||||||
|
vim.api.nvim_set_keymap('c', '<Down>', 'v:lua.get_wildmenu_key("<right>", "<down>")', { expr = true })
|
||||||
|
vim.api.nvim_set_keymap('c', '<Up>', 'v:lua.get_wildmenu_key("<left>", "<up>")', { expr = true })
|
||||||
|
|
||||||
|
function _G.get_wildmenu_key(key_wildmenu, key_regular)
|
||||||
|
return vim.fn.wildmenumode() ~= 0 and key_wildmenu or key_regular
|
||||||
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
extraLuaPackages = with pkgs.lua51Packages; [
|
extraLuaPackages = with pkgs.lua51Packages; [
|
||||||
@ -138,6 +162,7 @@ in {
|
|||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
vim-airline-themes
|
vim-airline-themes
|
||||||
nvim-web-devicons
|
nvim-web-devicons
|
||||||
|
nui-nvim # For noice
|
||||||
# nvim-nio # For rest
|
# nvim-nio # For rest
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -205,6 +230,18 @@ in {
|
|||||||
action = ">gv";
|
action = ">gv";
|
||||||
options.desc = "Indent";
|
options.desc = "Indent";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<";
|
||||||
|
action = "v<<Esc>";
|
||||||
|
options.desc = "Outdent";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = ">";
|
||||||
|
action = "v><Esc>";
|
||||||
|
options.desc = "Indent";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<C-d>";
|
key = "<C-d>";
|
||||||
@ -247,8 +284,32 @@ in {
|
|||||||
action = "<C-w>";
|
action = "<C-w>";
|
||||||
options.desc = "Delete previous word";
|
options.desc = "Delete previous word";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "i";
|
||||||
|
key = "<C-S-v>";
|
||||||
|
action = "<Esc>\"+pi";
|
||||||
|
options.desc = "Paste from clipboard";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "v";
|
||||||
|
key = "<C-S-c>";
|
||||||
|
action = "\"+y";
|
||||||
|
options.desc = "Copy to clipboard";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<C-h>";
|
||||||
|
action = "<cmd>nohlsearch<CR>";
|
||||||
|
options.desc = "Clear search highlights";
|
||||||
|
}
|
||||||
|
|
||||||
# General <leader>
|
# General <leader>
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>qq";
|
||||||
|
action = "<cmd>quitall<CR>";
|
||||||
|
options.desc = "Quit";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>f";
|
key = "<leader>f";
|
||||||
@ -275,9 +336,9 @@ in {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>d";
|
key = "<leader>r";
|
||||||
action = "<cmd>Telescope diagnostics<CR>";
|
action = "<cmd>Telescope resume<CR>";
|
||||||
options.desc = "View diagnostics";
|
options.desc = "Show last telescope picker";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
@ -291,6 +352,30 @@ in {
|
|||||||
action = "<cmd>Telescope commands<CR>";
|
action = "<cmd>Telescope commands<CR>";
|
||||||
options.desc = "Execute command";
|
options.desc = "Execute command";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>M";
|
||||||
|
action = "<cmd>Telescope marks<CR>";
|
||||||
|
options.desc = "Show marks";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>J";
|
||||||
|
action = "<cmd>Telescope jumplist<CR>";
|
||||||
|
options.desc = "Show jumplist";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>m";
|
||||||
|
action = "<cmd>Telescope man_pages<CR>";
|
||||||
|
options.desc = "Show manpages";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>h";
|
||||||
|
action = "<cmd>Telescope help_tags<CR>";
|
||||||
|
options.desc = "Show help tags";
|
||||||
|
}
|
||||||
|
|
||||||
# Buffers <leader>b
|
# Buffers <leader>b
|
||||||
{
|
{
|
||||||
@ -318,7 +403,7 @@ in {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>bq";
|
key = "<leader>bd";
|
||||||
action = "<cmd>Bdelete<CR>";
|
action = "<cmd>Bdelete<CR>";
|
||||||
options.desc = "Close current buffer";
|
options.desc = "Close current buffer";
|
||||||
}
|
}
|
||||||
@ -332,12 +417,18 @@ in {
|
|||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>ws";
|
key = "<leader>ws";
|
||||||
|
action = "<C-w>s";
|
||||||
|
options.desc = "Split window horizontally";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>wv";
|
||||||
action = "<C-w>v";
|
action = "<C-w>v";
|
||||||
options.desc = "Split window vertically";
|
options.desc = "Split window vertically";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>wq";
|
key = "<leader>wd";
|
||||||
action = "<C-w>c";
|
action = "<C-w>c";
|
||||||
options.desc = "Close current window";
|
options.desc = "Close current window";
|
||||||
}
|
}
|
||||||
@ -387,9 +478,15 @@ in {
|
|||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>tt";
|
key = "<leader>tt";
|
||||||
action = "<cmd>Neotree toggle<CR>";
|
action = "<cmd>Neotree action=show toggle=true<CR>";
|
||||||
options.desc = "Toggle NeoTree";
|
options.desc = "Toggle NeoTree";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>tn";
|
||||||
|
action = "<cmd>Navbuddy<CR>";
|
||||||
|
options.desc = "Toggle NavBuddy";
|
||||||
|
}
|
||||||
# {
|
# {
|
||||||
# mode = "n";
|
# mode = "n";
|
||||||
# key = "<leader>tg";
|
# key = "<leader>tg";
|
||||||
@ -449,19 +546,67 @@ in {
|
|||||||
options.desc = "View Git log for current file";
|
options.desc = "View Git log for current file";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# LSP <leader>l
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>l";
|
||||||
|
action = "+lsp";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>lr";
|
||||||
|
action = "<cmd>Telescope lsp_references<CR>";
|
||||||
|
options.desc = "Goto references";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>ld";
|
||||||
|
action = "<cmd>Telescope lsp_definitions<CR>";
|
||||||
|
options.desc = "Goto definition";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>li";
|
||||||
|
action = "<cmd>Telescope lsp_implementations<CR>";
|
||||||
|
options.desc = "Goto implementation";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>lt";
|
||||||
|
action = "<cmd>Telescope lsp_type_definitions<CR>";
|
||||||
|
options.desc = "Goto type definition";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>lI";
|
||||||
|
action = "<cmd>Telescope lsp_incoming_calls<CR>";
|
||||||
|
options.desc = "Show incoming calls";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>lO";
|
||||||
|
action = "<cmd>Telescope lsp_outgoing_calls<CR>";
|
||||||
|
options.desc = "Show outgoing calls";
|
||||||
|
}
|
||||||
|
|
||||||
# Code <leader>c
|
# Code <leader>c
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>c";
|
key = "<leader>c";
|
||||||
action = "+code";
|
action = "+code";
|
||||||
}
|
}
|
||||||
# TODO: Autoformat https://github.com/redyf/Neve/blob/main/config/lsp/conform.nix
|
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>cf";
|
key = "<leader>cf";
|
||||||
action = "<cmd>lua require('conform').format()<CR>";
|
action = "<cmd>lua require('conform').format()<CR>";
|
||||||
options.desc = "Format current buffer";
|
options.desc = "Format current buffer";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>cd";
|
||||||
|
action = "<cmd>Telescope diagnostics<CR>";
|
||||||
|
options.desc = "View diagnostics";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
plugins = {
|
plugins = {
|
||||||
@ -514,7 +659,6 @@ in {
|
|||||||
# Completion engine
|
# Completion engine
|
||||||
cmp = {
|
cmp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
autoEnableSources = false;
|
autoEnableSources = false;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
@ -548,14 +692,104 @@ in {
|
|||||||
['<Esc>'] = cmp.mapping.abort(),
|
['<Esc>'] = cmp.mapping.abort(),
|
||||||
['<C-Up>'] = cmp.mapping.scroll_docs(-4),
|
['<C-Up>'] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-Down>'] = cmp.mapping.scroll_docs(4),
|
['<C-Down>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
-- ['<C-Space>'] = cmp.complete(),
|
||||||
|
|
||||||
|
['<CR>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
if require('luasnip').expandable() then
|
||||||
|
require('luasnip').expand()
|
||||||
|
else
|
||||||
|
cmp.confirm({ select = true })
|
||||||
|
end
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif require('luasnip').locally_jumpable(1) then
|
||||||
|
require('luasnip').jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif require('luasnip').locally_jumpable(-1) then
|
||||||
|
require('luasnip').jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfigLua = ''
|
||||||
|
-- local cmp = require('cmp')
|
||||||
|
|
||||||
|
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
-- cmp.setup.cmdline({'/', "?" }, {
|
||||||
|
-- sources = {
|
||||||
|
-- { name = 'buffer' }
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- Set configuration for specific filetype.
|
||||||
|
-- cmp.setup.filetype('gitcommit', {
|
||||||
|
-- sources = cmp.config.sources({
|
||||||
|
-- { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
||||||
|
-- }, {
|
||||||
|
-- { name = 'buffer' },
|
||||||
|
-- })
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
-- cmp.setup.cmdline(':', {
|
||||||
|
-- sources = cmp.config.sources({
|
||||||
|
-- { name = 'path' }
|
||||||
|
-- }, {
|
||||||
|
-- { name = 'cmdline' }
|
||||||
|
-- }),
|
||||||
|
-- })
|
||||||
|
|
||||||
|
kind_icons = {
|
||||||
|
Text = "",
|
||||||
|
Method = "",
|
||||||
|
Function = "",
|
||||||
|
Constructor = "",
|
||||||
|
Field = "",
|
||||||
|
Variable = "",
|
||||||
|
Class = "",
|
||||||
|
Interface = "",
|
||||||
|
Module = "",
|
||||||
|
Property = "",
|
||||||
|
Unit = "",
|
||||||
|
Value = "",
|
||||||
|
Enum = "",
|
||||||
|
Keyword = "",
|
||||||
|
Snippet = "",
|
||||||
|
Color = "",
|
||||||
|
File = "",
|
||||||
|
Reference = "",
|
||||||
|
Folder = "",
|
||||||
|
EnumMember = "",
|
||||||
|
Constant = "",
|
||||||
|
Struct = "",
|
||||||
|
Event = "",
|
||||||
|
Operator = "",
|
||||||
|
TypeParameter = "",
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cmp-async-path.enable = true;
|
cmp-async-path.enable = true;
|
||||||
|
cmp-buffer.enable = true;
|
||||||
cmp-emoji.enable = true;
|
cmp-emoji.enable = true;
|
||||||
cmp-nvim-lsp.enable = true;
|
cmp-nvim-lsp.enable = true;
|
||||||
cmp-nvim-lsp-signature-help.enable = true;
|
cmp-nvim-lsp-signature-help.enable = true;
|
||||||
@ -573,7 +807,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Setup formatters
|
# TODO: Format on save + format region after paste
|
||||||
# File formatter in addition to LSP (uses LSP as fallback)
|
# File formatter in addition to LSP (uses LSP as fallback)
|
||||||
conform-nvim = {
|
conform-nvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -593,7 +827,8 @@ in {
|
|||||||
rust = ["rustfmt"];
|
rust = ["rustfmt"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: formatOnSave = " [???] ";
|
# TODO: Autoformat https://github.com/redyf/Neve/blob/main/config/lsp/conform.nix
|
||||||
|
# formatOnSave = " [???] ";
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Figure out how debugging from nvim works...
|
# TODO: Figure out how debugging from nvim works...
|
||||||
@ -607,7 +842,6 @@ in {
|
|||||||
# enable = false;
|
# enable = false;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# TODO: Compare after telescope etc. are enabled
|
|
||||||
# Changes nvim UI components, alternative to Noice
|
# Changes nvim UI components, alternative to Noice
|
||||||
# dressing = {
|
# dressing = {
|
||||||
# enable = false;
|
# enable = false;
|
||||||
@ -618,12 +852,6 @@ in {
|
|||||||
# enable = true;
|
# enable = true;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# TODO: Doesn't work
|
|
||||||
# Search labels
|
|
||||||
# flash = {
|
|
||||||
# enable = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# Git client
|
# Git client
|
||||||
# fugitive = {
|
# fugitive = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
@ -639,6 +867,7 @@ in {
|
|||||||
# Display message of commit that modified the current line
|
# Display message of commit that modified the current line
|
||||||
gitmessenger = {
|
gitmessenger = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
noDefaultMappings = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Alternative to gitgutter
|
# Alternative to gitgutter
|
||||||
@ -655,12 +884,6 @@ in {
|
|||||||
# enable = false;
|
# enable = false;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# TODO: Maybe, don't know yet (also, telescope)
|
|
||||||
# Mark files and jump to them
|
|
||||||
# harpoon = {
|
|
||||||
# enable = false;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# Markdown etc. heading highlights
|
# Markdown etc. heading highlights
|
||||||
headlines = {
|
headlines = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -669,6 +892,17 @@ in {
|
|||||||
# Alternative to cursorline
|
# Alternative to cursorline
|
||||||
illuminate = {
|
illuminate = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
filetypesDenylist = [
|
||||||
|
"DressingSelect"
|
||||||
|
"Outline"
|
||||||
|
"TelescopePrompt"
|
||||||
|
"alpha"
|
||||||
|
"harpoon"
|
||||||
|
"toggleterm"
|
||||||
|
"neo-tree"
|
||||||
|
"Spectre"
|
||||||
|
"reason"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Live-preview of LSP renamings
|
# Live-preview of LSP renamings
|
||||||
@ -681,30 +915,87 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Open file at last place
|
||||||
|
lastplace = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
lazygit = {
|
lazygit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: More linters
|
|
||||||
# Linting as addition to LSP
|
# Linting as addition to LSP
|
||||||
lint = {
|
lint = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
lintersByFt = {
|
lintersByFt = {
|
||||||
text = ["vale"];
|
c = ["clang-tidy"];
|
||||||
|
h = ["clang-tidy"];
|
||||||
|
cpp = ["clang-tidy"];
|
||||||
|
hpp = ["clang-tidy"];
|
||||||
|
clojure = ["clj-kondo"];
|
||||||
|
java = ["checkstyle"];
|
||||||
|
javascript = ["eslint_d"];
|
||||||
markdown = ["vale"];
|
markdown = ["vale"];
|
||||||
|
nix = ["statix"];
|
||||||
|
python = ["flake8"];
|
||||||
|
rust = ["clippy"];
|
||||||
|
text = ["vale"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: More LSP servers
|
|
||||||
# Language-Server-Protocol
|
# Language-Server-Protocol
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
servers = {
|
servers = {
|
||||||
|
clangd.enable = true;
|
||||||
|
clojure-lsp.enable = true;
|
||||||
|
cmake.enable = true;
|
||||||
|
cssls.enable = true;
|
||||||
|
dockerls.enable = true;
|
||||||
|
eslint.enable = true;
|
||||||
|
hls.enable = true;
|
||||||
|
html.enable = true;
|
||||||
|
java-language-server.enable = true;
|
||||||
|
jsonls.enable = true;
|
||||||
|
ltex = {
|
||||||
|
enable = true;
|
||||||
|
autostart = true;
|
||||||
|
};
|
||||||
|
marksman.enable = true;
|
||||||
nil_ls.enable = true;
|
nil_ls.enable = true;
|
||||||
|
pyright.enable = true;
|
||||||
|
rust-analyzer = {
|
||||||
|
enable = true;
|
||||||
|
installCargo = false;
|
||||||
|
installRustc = false;
|
||||||
|
};
|
||||||
|
tailwindcss.enable = true;
|
||||||
|
texlab.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
keymaps = {
|
||||||
|
lspBuf = {
|
||||||
|
K = {
|
||||||
|
action = "hover";
|
||||||
|
desc = "Hover";
|
||||||
|
};
|
||||||
|
"<leader>cr" = {
|
||||||
|
action = "rename";
|
||||||
|
desc = "Rename";
|
||||||
|
};
|
||||||
|
"<leader>ca" = {
|
||||||
|
action = "code_action";
|
||||||
|
desc = "Code Action";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# lsp-format = {
|
||||||
|
# enable = false;
|
||||||
|
# };
|
||||||
|
|
||||||
# Render diagnostics as virtual line overlay
|
# Render diagnostics as virtual line overlay
|
||||||
# lsp-lines = {
|
# lsp-lines = {
|
||||||
@ -715,22 +1006,37 @@ in {
|
|||||||
lualine = {
|
lualine = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
alwaysDivideMiddle = true;
|
||||||
globalstatus = true;
|
globalstatus = true;
|
||||||
|
ignoreFocus = ["neo-tree"];
|
||||||
|
extensions = ["fzf"];
|
||||||
|
|
||||||
|
sections = {
|
||||||
|
lualine_a = ["mode"];
|
||||||
|
lualine_b = ["branch" "diff" "diagnostics"];
|
||||||
|
lualine_c = ["filename"];
|
||||||
|
|
||||||
|
lualine_x = ["filetype" "encoding" "fileformat"];
|
||||||
|
lualine_y = ["progress"];
|
||||||
|
lualine_z = ["location" "searchcount" "selectioncount"];
|
||||||
|
};
|
||||||
|
|
||||||
sectionSeparators = {
|
sectionSeparators = {
|
||||||
left = "";
|
left = "";
|
||||||
right = "";
|
right = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
componentSeparators = {
|
componentSeparators = {
|
||||||
left = "";
|
left = "";
|
||||||
right = "";
|
right = "";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO: Snippet configs
|
||||||
luasnip = {
|
luasnip = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: When I start actually using marks
|
|
||||||
# Show marks in the gutter
|
# Show marks in the gutter
|
||||||
# marks = {
|
# marks = {
|
||||||
# enable = false;
|
# enable = false;
|
||||||
@ -741,6 +1047,7 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
lsp.autoAttach = true;
|
lsp.autoAttach = true;
|
||||||
|
window.border = "rounded";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Generate doc comments
|
# Generate doc comments
|
||||||
@ -748,7 +1055,6 @@ in {
|
|||||||
# enable = true;
|
# enable = true;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# TODO: When I need this
|
|
||||||
# Interact with test frameworks
|
# Interact with test frameworks
|
||||||
# neotest = {
|
# neotest = {
|
||||||
# enable = false;
|
# enable = false;
|
||||||
@ -765,9 +1071,9 @@ in {
|
|||||||
popupBorderStyle = "rounded";
|
popupBorderStyle = "rounded";
|
||||||
|
|
||||||
buffers = {
|
buffers = {
|
||||||
bindToCwd = false;
|
bindToCwd = true;
|
||||||
followCurrentFile = {
|
followCurrentFile = {
|
||||||
enabled = true;
|
enabled = true; # TODO: Doesn't work
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -781,15 +1087,40 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# NeoVim UI refresh, alternative to fidget, dressing and notify
|
# NeoVim UI refresh, alternative to fidget, dressing, notify and lspsaga
|
||||||
noice = {
|
noice = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
lsp.override = {
|
presets = {
|
||||||
|
bottom_search = false;
|
||||||
|
command_palette = true;
|
||||||
|
long_message_to_split = true;
|
||||||
|
inc_rename = true;
|
||||||
|
lsp_doc_border = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
documentation = {
|
||||||
|
opts = {
|
||||||
|
lang = "markdown";
|
||||||
|
replace = true;
|
||||||
|
render = "plain";
|
||||||
|
border = "rounded"; # single or rounded
|
||||||
|
format = ["{message}"];
|
||||||
|
win_options = {
|
||||||
|
concealcursor = "n";
|
||||||
|
conceallevel = 3;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
view = "hover";
|
||||||
|
};
|
||||||
|
|
||||||
|
override = {
|
||||||
"vim.lsp.util.convert_input_to_markdown_lines" = true;
|
"vim.lsp.util.convert_input_to_markdown_lines" = true;
|
||||||
"vim.lsp.util.stylize_markdown" = true;
|
"vim.lsp.util.stylize_markdown" = true;
|
||||||
"cmp.entry.get_documentation" = true;
|
"cmp.entry.get_documentation" = true;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
notify = {
|
notify = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
@ -797,16 +1128,19 @@ in {
|
|||||||
|
|
||||||
popupmenu = {
|
popupmenu = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
backend = "cmp";
|
backend = "nui";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# cmdline.enabled = false;
|
||||||
|
# messages.enabled = false;
|
||||||
|
|
||||||
routes = [
|
routes = [
|
||||||
{
|
{
|
||||||
filter = {
|
filter = {
|
||||||
event = "msg_show";
|
event = "msg_show";
|
||||||
kind = "search_count";
|
kind = "search_count";
|
||||||
};
|
};
|
||||||
opts = { skip = true; };
|
opts = {skip = true;};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -826,7 +1160,6 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Folds the entire code at startup???
|
|
||||||
# Code folding
|
# Code folding
|
||||||
nvim-ufo = {
|
nvim-ufo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -848,11 +1181,6 @@ in {
|
|||||||
# enable = false;
|
# enable = false;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# rustaceanvim = {
|
|
||||||
# enable = false;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# Work with pairs of delimiters
|
# Work with pairs of delimiters
|
||||||
sandwich = {
|
sandwich = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -863,12 +1191,6 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Doesn't show up
|
|
||||||
# Left-hand side status column with folding markers
|
|
||||||
# statuscol = {
|
|
||||||
# enable = false;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# Select something
|
# Select something
|
||||||
telescope = {
|
telescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -878,18 +1200,55 @@ in {
|
|||||||
ui-select.enable = true;
|
ui-select.enable = true;
|
||||||
undo.enable = true;
|
undo.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
"<esc>" = {
|
||||||
|
__raw = ''
|
||||||
|
function(...)
|
||||||
|
return require("telescope.actions").close(...)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
toggleterm = {
|
toggleterm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
open_mapping = "[[<C-t>]]";
|
||||||
|
hide_numbers = true;
|
||||||
|
shade_terminals = true;
|
||||||
|
start_in_insert = true;
|
||||||
|
terminal_mappings = true;
|
||||||
|
persist_mode = true;
|
||||||
|
insert_mappings = true;
|
||||||
|
close_on_exit = true;
|
||||||
|
shell = "fish";
|
||||||
|
direction = "horizontal"; # 'vertical' | 'horizontal' | 'window' | 'float'
|
||||||
|
auto_scroll = true;
|
||||||
|
float_opts = {
|
||||||
|
border = "curved"; # 'single' | 'double' | 'shadow' | 'curved'
|
||||||
|
width = 80;
|
||||||
|
height = 20;
|
||||||
|
winblend = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
ensureInstalled = "all";
|
ensureInstalled = "all";
|
||||||
folding = true; # TODO: Folds at startup
|
folding = true;
|
||||||
indent = true; # Required by intellitab
|
indent = true; # Required by intellitab
|
||||||
|
nixvimInjections = true;
|
||||||
|
|
||||||
incrementalSelection = {
|
incrementalSelection = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Reference in New Issue
Block a user