Compare commits

...

3 commits

Author SHA1 Message Date
Geoffrey Frogeye 7cd77af9bf
vim: Move more things to prose 2024-01-20 19:36:49 +01:00
Geoffrey Frogeye a57c6527ce
vim: Fix lsp todos 2024-01-20 19:36:47 +01:00
Geoffrey Frogeye 97a3e5f6e4
vim: Fix Reload command 2024-01-20 19:36:45 +01:00
4 changed files with 53 additions and 38 deletions

View file

@ -144,6 +144,8 @@ in
# misc
gnome.gedit
xfce.thunar
nomacs
feh
zbar
zathura

View file

@ -12,11 +12,26 @@
# TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr
];
};
programs.nixvim.plugins.none-ls = {
enable = true;
sources = {
code_actions.ltrs.enable = true;
diagnostics.ltrs.enable = true;
programs.nixvim = {
autoCmd = [
# vim-easy-align: Align Markdown tables with |
{ event = "FileType"; pattern = "markdown"; command = "vmap <Bar> :EasyAlign*<Bar><Enter>"; }
];
extraPlugins = with pkgs.vimPlugins; lib.optionals config.programs.pandoc.enable [
vim-pandoc # Pandoc-specific stuff because there's no LSP for it
vim-pandoc-syntax
];
extraConfigVim = lib.optionalString config.programs.pandoc.enable ''
let g:pandoc#modules#disabled = ["folding"]
let g:pandoc#spell#enabled = 0
let g:pandoc#syntax#conceal#use = 0
'';
plugins.none-ls = {
enable = true;
sources = {
code_actions.ltrs.enable = true;
diagnostics.ltrs.enable = true;
};
};
};
};

View file

@ -50,10 +50,6 @@
gH = "command_history";
gS = "search_history";
gC = "commands";
gr = "lsp_references";
ge = "diagnostics";
gd = "lsp_definitions";
gs = "lsp_document_symbols";
};
defaults = {
vimgrep_arguments = [
@ -91,37 +87,18 @@
# Language-specific
tcomment_vim # Language-aware (un)commenting
] ++ lib.optionals config.programs.pandoc.enable [
vim-pandoc # Pandoc-specific stuff because there's no LSP for it
vim-pandoc-syntax
] ++ lib.optionals config.frogeye.dev.ansible [
ansible-vim
# Doesn't generate snippets, but those are for UltiSnip anyways
];
extraConfigVim = ''
" GENERAL
" Avoid showing message extra message when using completion
set shortmess+=c
command Reload source $MYVIMRC
" PLUGINS
'' + lib.optionalString config.programs.pandoc.enable ''
" vim-pandox
let g:pandoc#modules#disabled = ["folding"]
let g:pandoc#spell#enabled = 0
let g:pandoc#syntax#conceal#use = 0
'';
autoCmd = [
# vim-easy-align: Align Markdown tables
{ event = "FileType"; pattern = "markdown"; command = "vmap <Bar> :EasyAlign*<Bar><Enter>"; }
];
userCommands = {
# Reload = { command = "source $MYVIRMC"; };
# TODO Is not working, options is set to nil even though it shouldn't
Reload = { command = "source ${config.xdg.configHome}/nvim/init.lua"; force = false; };
# 24.05 force=false was for https://github.com/nix-community/nixvim/issues/954
};
keymaps = [

View file

@ -12,6 +12,28 @@
lsp_signature-nvim # Show argument definition when typing a function
];
keymaps = [
{
mode = "n";
key = "<space>wl";
lua = true;
action = ''
function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end
'';
options.silent = true;
}
{
mode = "n";
key = "<space>f";
lua = true;
action = ''
function()
vim.lsp.buf.format { async = true }
end
'';
options.silent = true;
}
];
plugins = {
# Language Server
@ -25,25 +47,24 @@
"]e" = "goto_next";
};
lspBuf = {
# TODO Include the Telescope ones in this file
"gD" = "declaration";
"K" = "hover";
"gi" = "implementation";
"<C-S-k>" = "signature_help";
"<space>wa" = "add_workspace_folder";
"<space>wr" = "remove_workspace_folder";
# "<space>wl" = "list_workspace_folder";
# TODO Full thing was function() print(vim.inspect(vim.lsp.buf.list_workspace_folder())) end but not sure I'm ever really using this
# Also makes nvim crash like this, so uncommented
"<space>D" = "type_definition";
"<space>rn" = "rename";
"<space>ca" = "code_action";
"<space>f" = "format";
# TODO Full thing was function() vim.lsp.buf.format { async = true } end, so async while this isn't
# Maybe replace this with lsp-format?
"<space>ca" = "code_action"; # Reference has a binding for visual mode, but it doesn't work
};
};
};
telescope.keymaps = {
gr = "lsp_references";
ge = "diagnostics";
gd = "lsp_definitions";
gs = "lsp_document_symbols";
};
nvim-lightbulb = {
# Shows a lightbulb whenever a codeAction is available under the cursor
enable = true;