From b9a56d0075cb3a70af6fd27cb7fc6b780d62a1b5 Mon Sep 17 00:00:00 2001 From: Eduardo Cueto-Mendoza Date: Fri, 3 Jan 2025 13:41:55 +0000 Subject: [PATCH] New Neovim configuration style and packages (future will reduce the package number) --- .config/{nvim => }/LICENSE | 2 +- .config/fish/completions/fish-lsp.fish | 131 +++++++++ .config/ghostty/config | 5 +- .config/nvim/.gitignore | 1 - .config/nvim/.stylua.toml | 2 + .config/nvim/README.md | 2 - .config/nvim/TODO.md | 6 - .config/nvim/after/plugin/01_color.lua | 28 -- .config/nvim/after/plugin/02_treesitter.lua | 56 ---- .config/nvim/after/plugin/03_mason.lua | 11 - .config/nvim/after/plugin/04_lspconfig.lua | 114 ------- .config/nvim/after/plugin/05_completion.lua | 107 ------- .../nvim/after/plugin/06_mason-lspconfig.lua | 13 - .config/nvim/after/plugin/07_rust.lua | 18 -- .config/nvim/after/plugin/08_harpoon.lua | 10 - .config/nvim/after/plugin/09_telescope.lua | 78 ----- .config/nvim/after/plugin/10_neoclip.lua | 59 ---- .config/nvim/after/plugin/11_nvim-tree.lua | 18 -- .config/nvim/after/plugin/12_parenthesis.lua | 25 -- .config/nvim/after/plugin/13_terminal.lua | 8 - .../{plugin => plugins}/dictionary-gb.txt | 1 - .../nvim/after/queries/ecma/textobjects.scm | 5 + .config/nvim/init.lua | 5 +- .config/nvim/lua/eddie/lazy.lua | 254 ---------------- .config/nvim/lua/eddie/options.lua | 268 ----------------- .config/nvim/lua/user/core/init.lua | 2 + .../remaps.lua => user/core/keymaps.lua} | 59 +++- .config/nvim/lua/user/core/options.lua | 86 ++++++ .config/nvim/lua/user/lazy.lua | 22 ++ .../nvim/lua/user/plugins/00_colorscheme.lua | 45 +++ .../nvim/lua/user/plugins/01_treesitter.lua | 47 +++ .../02_nvim-treesitter-text-objects.lua | 116 ++++++++ .config/nvim/lua/user/plugins/03_nvim-cmp.lua | 120 ++++++++ .config/nvim/lua/user/plugins/04_linting.lua | 24 ++ .config/nvim/lua/user/plugins/05_compiler.lua | 27 ++ .../nvim/lua/user/plugins/06_rustacean.lua | 20 ++ .config/nvim/lua/user/plugins/07_vimtex.lua | 88 ++++++ .config/nvim/lua/user/plugins/08_fugitive.lua | 6 + .config/nvim/lua/user/plugins/09_gitsigns.lua | 17 ++ .../lua/user/plugins/10_todo-comments.lua | 21 ++ .../nvim/lua/user/plugins/11_telescope.lua | 57 ++++ .config/nvim/lua/user/plugins/12_neorg.lua | 22 ++ .config/nvim/lua/user/plugins/13_terminal.lua | 13 + .../lua/user/plugins/14_vim-maximizer.lua | 6 + .../nvim/lua/user/plugins/15_autopairs.lua | 30 ++ .config/nvim/lua/user/plugins/16_surround.lua | 6 + .../nvim/lua/user/plugins/17_which-key.lua | 13 + .../nvim/lua/user/plugins/18_nvim-tree.lua | 62 ++++ .config/nvim/lua/user/plugins/19_trouble.lua | 15 + .../nvim/lua/user/plugins/20_substitute.lua | 17 ++ .config/nvim/lua/user/plugins/21_lualine.lua | 71 +++++ .../nvim/lua/user/plugins/22_formatting.lua | 39 +++ .../lua/user/plugins/23_indent-blankline.lua | 8 + .config/nvim/lua/user/plugins/24_alpha.lua | 36 +++ .../nvim/lua/user/plugins/25_auto-session.lua | 16 + .config/nvim/lua/user/plugins/26_dressing.lua | 4 + .config/nvim/lua/user/plugins/27_comment.lua | 19 ++ .../nvim/lua/user/plugins/28_bufferline.lua | 10 + .config/nvim/lua/user/plugins/init.lua | 5 + .../nvim/lua/user/plugins/lsp/00_mason.lua | 46 +++ .../lua/user/plugins/lsp/01_lspconfig.lua | 277 ++++++++++++++++++ .config/nvim/spell/en.utf-8.add | 21 -- .config/nvim/spell/en.utf-8.add.spl | Bin 307 -> 0 bytes 63 files changed, 1603 insertions(+), 1117 deletions(-) rename .config/{nvim => }/LICENSE (97%) mode change 100755 => 100644 create mode 100644 .config/fish/completions/fish-lsp.fish mode change 100755 => 100644 .config/nvim/.gitignore create mode 100644 .config/nvim/.stylua.toml delete mode 100755 .config/nvim/README.md delete mode 100755 .config/nvim/TODO.md delete mode 100755 .config/nvim/after/plugin/01_color.lua delete mode 100755 .config/nvim/after/plugin/02_treesitter.lua delete mode 100644 .config/nvim/after/plugin/03_mason.lua delete mode 100644 .config/nvim/after/plugin/04_lspconfig.lua delete mode 100644 .config/nvim/after/plugin/05_completion.lua delete mode 100644 .config/nvim/after/plugin/06_mason-lspconfig.lua delete mode 100644 .config/nvim/after/plugin/07_rust.lua delete mode 100755 .config/nvim/after/plugin/08_harpoon.lua delete mode 100755 .config/nvim/after/plugin/09_telescope.lua delete mode 100755 .config/nvim/after/plugin/10_neoclip.lua delete mode 100755 .config/nvim/after/plugin/11_nvim-tree.lua delete mode 100755 .config/nvim/after/plugin/12_parenthesis.lua delete mode 100755 .config/nvim/after/plugin/13_terminal.lua rename .config/nvim/after/{plugin => plugins}/dictionary-gb.txt (99%) create mode 100644 .config/nvim/after/queries/ecma/textobjects.scm mode change 100755 => 100644 .config/nvim/init.lua delete mode 100755 .config/nvim/lua/eddie/lazy.lua delete mode 100755 .config/nvim/lua/eddie/options.lua create mode 100644 .config/nvim/lua/user/core/init.lua rename .config/nvim/lua/{eddie/remaps.lua => user/core/keymaps.lua} (55%) mode change 100755 => 100644 create mode 100644 .config/nvim/lua/user/core/options.lua create mode 100644 .config/nvim/lua/user/lazy.lua create mode 100644 .config/nvim/lua/user/plugins/00_colorscheme.lua create mode 100644 .config/nvim/lua/user/plugins/01_treesitter.lua create mode 100644 .config/nvim/lua/user/plugins/02_nvim-treesitter-text-objects.lua create mode 100644 .config/nvim/lua/user/plugins/03_nvim-cmp.lua create mode 100644 .config/nvim/lua/user/plugins/04_linting.lua create mode 100644 .config/nvim/lua/user/plugins/05_compiler.lua create mode 100644 .config/nvim/lua/user/plugins/06_rustacean.lua create mode 100644 .config/nvim/lua/user/plugins/07_vimtex.lua create mode 100644 .config/nvim/lua/user/plugins/08_fugitive.lua create mode 100644 .config/nvim/lua/user/plugins/09_gitsigns.lua create mode 100644 .config/nvim/lua/user/plugins/10_todo-comments.lua create mode 100644 .config/nvim/lua/user/plugins/11_telescope.lua create mode 100644 .config/nvim/lua/user/plugins/12_neorg.lua create mode 100644 .config/nvim/lua/user/plugins/13_terminal.lua create mode 100644 .config/nvim/lua/user/plugins/14_vim-maximizer.lua create mode 100644 .config/nvim/lua/user/plugins/15_autopairs.lua create mode 100644 .config/nvim/lua/user/plugins/16_surround.lua create mode 100644 .config/nvim/lua/user/plugins/17_which-key.lua create mode 100644 .config/nvim/lua/user/plugins/18_nvim-tree.lua create mode 100644 .config/nvim/lua/user/plugins/19_trouble.lua create mode 100644 .config/nvim/lua/user/plugins/20_substitute.lua create mode 100644 .config/nvim/lua/user/plugins/21_lualine.lua create mode 100644 .config/nvim/lua/user/plugins/22_formatting.lua create mode 100644 .config/nvim/lua/user/plugins/23_indent-blankline.lua create mode 100644 .config/nvim/lua/user/plugins/24_alpha.lua create mode 100644 .config/nvim/lua/user/plugins/25_auto-session.lua create mode 100644 .config/nvim/lua/user/plugins/26_dressing.lua create mode 100644 .config/nvim/lua/user/plugins/27_comment.lua create mode 100644 .config/nvim/lua/user/plugins/28_bufferline.lua create mode 100644 .config/nvim/lua/user/plugins/init.lua create mode 100644 .config/nvim/lua/user/plugins/lsp/00_mason.lua create mode 100644 .config/nvim/lua/user/plugins/lsp/01_lspconfig.lua delete mode 100755 .config/nvim/spell/en.utf-8.add delete mode 100755 .config/nvim/spell/en.utf-8.add.spl diff --git a/.config/nvim/LICENSE b/.config/LICENSE old mode 100755 new mode 100644 similarity index 97% rename from .config/nvim/LICENSE rename to .config/LICENSE index 1b9c40c..c6fb7ba --- a/.config/nvim/LICENSE +++ b/.config/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2023, Eduardo Cueto Mendoza +Copyright (c) 2023, Eduardo Cueto-Mendoza Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/.config/fish/completions/fish-lsp.fish b/.config/fish/completions/fish-lsp.fish new file mode 100644 index 0000000..d233096 --- /dev/null +++ b/.config/fish/completions/fish-lsp.fish @@ -0,0 +1,131 @@ +# +# AUTO GENERATED BY 'fish-lsp' +# +# * Any command should generate the completions file +# +# >_ fish-lsp complete > ~/.config/fish/completions/fish-lsp.fish +# >_ fish-lsp complete --fish > ~/.config/fish/completions/fish-lsp.fish +# >_ yarn install # from inside the 'fish-lsp' +# +# * You can test the completions by editing: +# +# ~/.config/fish/completions/fish-lsp.fish +# +# or by using the command: +# +# >_ fish-lsp complete +# +# to visually check what is wrong +# +# * For more info, try editing the generated output inside: +# +# ~/...install_path.../fish-lsp/src/utils/get-lsp-completions.ts +# + + +# Returns exit code of 0 if any command (argv[1..-1]) appears once, ignores flags. +function __fish_lsp_using_command + set -l commands $argv + set -l cmd (commandline -opc) + if test (count $cmd) -gt 1 + set -l command_seen_once 1 + for c in $cmd[2..-1] + switch $c + case '-*' + continue + case $commands + # If the command is seen more than once then return 1 + if test $command_seen_once -eq 1 + set command_seen_once 0 + else + return 1 + end + case '*' + if test $command_seen_once -eq 0 + return 0 + else + return 1 + end + end + end + return $command_seen_once + end + return 1 +end + +# disable file completions +complete -c fish-lsp -f + +complete -c fish-lsp -n "__fish_use_subcommand" -a " +start\t'subcmd to start the lsp using stdin/stdout' +logger\t'test the logger by displaying it' +info\t'show the build info of fish-lsp' +url\t'show a helpful url related to the fish-lsp' +complete\t'generate completions file for ~/.config/fish/completions' +env\t'generate fish shell env variables to be used by lsp'" + +set __fish_lsp_subcommands start + +# fish_lsp [start] -- +complete -c fish-lsp -n '__fish_seen_subcommand_from $__fish_lsp_subcommands' -a " +--dump\t'dump output and stop server' +--enable\t'enable feature' +--disable\t'disable feature'" + +# fish-lsp url -- +complete -c fish-lsp -n "__fish_seen_subcommand_from url" -a " +--repo 'show git url' +--git 'show git url' +--npm 'show npm url' +--homepage 'show homepage url' +--contributions 'show git contributions url' +--wiki 'show git wiki url' +--issues 'show git issues url' +--report 'show git issues url' +--discussions 'show git discussions url' +--clients-repo 'show git clients-repo url' +--sources 'show useful list of sources'" + +# fish-lsp complete +complete -c fish-lsp -n __fish_use_subcommand -a complete -d 'completion utils for fish-lsp cli' +complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt features' -l features -d 'show features' +complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt fish' -l fish -d 'show completion/fish-lsp.fish' +complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt names' -l names -d 'show feature names of completions' +complete -c fish-lsp -n '__fish_lsp_using_command complete; and not __fish_contains_opt toggle' -l toggle -d 'show feature names of completions' + +# fish-lsp info -- +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt bin' -l bin -d 'show the binary path' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt repo' -l repo -d 'show the repo path' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt time' -l time -d 'show the build-time' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt env' -l env -d 'show the env-variables used' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt lsp-version' -l lsp-version -d 'show the npm package for the lsp-version' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt capabilities' -l capabilities -d 'show the lsp capabilities implemented' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt man-file' -l man-file -d 'show man file path' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt logs-file' -l logs-file -d 'show logs.txt file path' +complete -c fish-lsp -n '__fish_lsp_using_command info; and not __fish_contains_opt more' -l more -d 'show more info' + +# fish-lsp logger -- +complete -c fish-lsp -n __fish_use_subcommand -x -a logger -d 'logger utilities' +complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s s show' -s s -l show -d 'show the "logs.txt" file' +complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s c clear' -s c -l clear -d 'clear the "logs.txt" file' +complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s q quiet' -s q -l quiet -d 'only write to "logs.txt" file' +complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt -s d date' -s d -l date -d 'write date to "logs.txt" file' +complete -c fish-lsp -n '__fish_lsp_using_command logger; and not __fish_contains_opt config' -l config -d 'show the logger config' + +# print all $fish_lsp_submcommands +function _fish_lsp_get_features + printf %b\n complete hover rename reference formatting codeAction codeLens folding signature executeCommand inlayHint highlight diagnostic +end + +# fish-lsp env -- +complete -c fish-lsp -n __fish_use_subcommand -x -a env -d 'generate fish shell env variables to be used by lsp' +complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt -s s show; and not __fish_contains_opt -s c create' -s s -l show -d 'show the current fish-lsp env variables' +complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt -s c create; and not __fish_contains_opt -s s show' -s c -l create -d 'build initial fish-lsp env variables' +complete -c fish-lsp -n '__fish_lsp_using_command env; and not __fish_contains_opt no-comments' -l no-comments -d 'skip outputting comments' + +# COMPLETION: fish-lsp subcmd