From a95aab0e510cd827a224d9204a92587588a62e7f Mon Sep 17 00:00:00 2001 From: sudacode Date: Fri, 14 Feb 2025 01:48:45 -0800 Subject: [PATCH] update to lua config --- autocommands.vim | 10 - coc-settings.json | 50 ----- init.lua | 9 + init.vim | 101 --------- keybindings.vim | 198 ------------------ lua/code_action_utils.lua | 15 -- lua/core/autocmds.lua | 51 +++++ lua/core/keymaps.lua | 158 ++++++++++++++ lua/{settings.lua => core/options.lua} | 0 lua/{ => core}/plugins.lua | 74 +------ lua/keybindings.lua | 3 - .../plugins/ai}/codecompanion.lua | 0 .../ai}/codecompanion/fidget-spinner.lua | 0 lua/plugins/ai/init.lua | 1 + .../plugins/colorscheme}/catppuccin.lua | 0 .../plugins/colorscheme}/dracula.lua | 0 lua/plugins/colorscheme/init.lua | 3 + .../plugins/colorscheme}/onedarkpro.lua | 0 .../plugins/lsp}/copilot-cmp.lua | 0 lua/plugins/lsp/init.lua | 10 + .../plugins/lsp}/lsp-format.lua | 0 .../plugins/lsp}/lsp-kind.lua | 0 .../plugins/lsp}/lspconfig.lua | 0 .../plugins/lsp}/lspfuzzy.lua | 0 .../plugins/lsp}/lsplines.lua | 0 {plugin-confs => lua/plugins/lsp}/luasnip.lua | 0 {plugin-confs => lua/plugins/lsp}/null-ls.lua | 0 .../plugins/lsp}/nvim-cmp.lua | 0 .../plugins/lsp}/nvim-lint.lua | 0 .../plugins/ui}/bufferline.lua | 0 .../plugins/ui}/copilot-lualine.lua | 0 .../plugins/ui}/dashboard-nvim.lua | 0 {plugin-confs => lua/plugins/ui}/fidget.lua | 0 .../plugins/ui}/git-blame.lua | 0 {plugin-confs => lua/plugins/ui}/gitsigns.lua | 0 lua/plugins/ui/init.lua | 17 ++ {plugin-confs => lua/plugins/ui}/lualine.lua | 0 .../plugins/ui}/nvim-colorizer.lua | 0 .../plugins/ui}/nvim-notify.lua | 0 {plugin-confs => lua/plugins/ui}/nvimtree.lua | 0 {plugin-confs => lua/plugins/ui}/presence.lua | 0 .../plugins/ui}/rainbow-delimiters.lua | 0 .../plugins/ui}/telescope-file-browser.lua | 0 .../plugins/ui}/telescope.lua | 2 +- .../plugins/ui}/treesitter-context.lua | 0 .../plugins/ui}/treesitter.lua | 0 {plugin-confs => lua/plugins/ui}/whichkey.lua | 0 lua/toggle_lsp_diagnostics.lua | 11 - plugin-confs/chatgpt.lua | 1 - plugin-confs/code_actions.lua | 14 -- plugin-confs/copilot.lua | 1 - plugin-confs/dashboard-art.vim | 8 - plugin-confs/doomone.lua | 57 ----- plugin-confs/github-theme.lua | 19 -- plugin-confs/goto-preview.lua | 19 -- plugin-confs/lsp-signature.lua | 47 ----- plugin-confs/neodev.lua | 3 - plugin-confs/neogit.lua | 73 ------- plugin-confs/nvim-dap-bash.lua | 31 --- plugin-confs/nvim-dap-python.lua | 51 ----- plugin-confs/nvim-dap-ui.lua | 7 - plugin-confs/nvim-dap-virtual-text.lua | 34 --- plugin-confs/nvim-docs-view.lua | 6 - plugin-confs/symbols-outline.lua | 53 ----- plugin-confs/trouble.lua | 47 ----- 65 files changed, 254 insertions(+), 930 deletions(-) delete mode 100644 autocommands.vim delete mode 100644 coc-settings.json create mode 100644 init.lua delete mode 100755 init.vim delete mode 100644 keybindings.vim delete mode 100644 lua/code_action_utils.lua create mode 100644 lua/core/autocmds.lua create mode 100644 lua/core/keymaps.lua rename lua/{settings.lua => core/options.lua} (100%) rename lua/{ => core}/plugins.lua (74%) delete mode 100644 lua/keybindings.lua rename {plugin-confs => lua/plugins/ai}/codecompanion.lua (100%) rename lua/{ => plugins/ai}/codecompanion/fidget-spinner.lua (100%) create mode 100644 lua/plugins/ai/init.lua rename {plugin-confs => lua/plugins/colorscheme}/catppuccin.lua (100%) rename {plugin-confs => lua/plugins/colorscheme}/dracula.lua (100%) create mode 100644 lua/plugins/colorscheme/init.lua rename {plugin-confs => lua/plugins/colorscheme}/onedarkpro.lua (100%) rename {plugin-confs => lua/plugins/lsp}/copilot-cmp.lua (100%) create mode 100644 lua/plugins/lsp/init.lua rename {plugin-confs => lua/plugins/lsp}/lsp-format.lua (100%) rename {plugin-confs => lua/plugins/lsp}/lsp-kind.lua (100%) rename {plugin-confs => lua/plugins/lsp}/lspconfig.lua (100%) rename {plugin-confs => lua/plugins/lsp}/lspfuzzy.lua (100%) rename {plugin-confs => lua/plugins/lsp}/lsplines.lua (100%) rename {plugin-confs => lua/plugins/lsp}/luasnip.lua (100%) rename {plugin-confs => lua/plugins/lsp}/null-ls.lua (100%) rename {plugin-confs => lua/plugins/lsp}/nvim-cmp.lua (100%) rename {plugin-confs => lua/plugins/lsp}/nvim-lint.lua (100%) rename {plugin-confs => lua/plugins/ui}/bufferline.lua (100%) rename {plugin-confs => lua/plugins/ui}/copilot-lualine.lua (100%) rename {plugin-confs => lua/plugins/ui}/dashboard-nvim.lua (100%) rename {plugin-confs => lua/plugins/ui}/fidget.lua (100%) rename {plugin-confs => lua/plugins/ui}/git-blame.lua (100%) rename {plugin-confs => lua/plugins/ui}/gitsigns.lua (100%) create mode 100644 lua/plugins/ui/init.lua rename {plugin-confs => lua/plugins/ui}/lualine.lua (100%) rename {plugin-confs => lua/plugins/ui}/nvim-colorizer.lua (100%) rename {plugin-confs => lua/plugins/ui}/nvim-notify.lua (100%) rename {plugin-confs => lua/plugins/ui}/nvimtree.lua (100%) rename {plugin-confs => lua/plugins/ui}/presence.lua (100%) rename {plugin-confs => lua/plugins/ui}/rainbow-delimiters.lua (100%) rename {plugin-confs => lua/plugins/ui}/telescope-file-browser.lua (100%) rename {plugin-confs => lua/plugins/ui}/telescope.lua (98%) rename {plugin-confs => lua/plugins/ui}/treesitter-context.lua (100%) rename {plugin-confs => lua/plugins/ui}/treesitter.lua (100%) rename {plugin-confs => lua/plugins/ui}/whichkey.lua (100%) delete mode 100644 lua/toggle_lsp_diagnostics.lua delete mode 100644 plugin-confs/chatgpt.lua delete mode 100644 plugin-confs/code_actions.lua delete mode 100644 plugin-confs/copilot.lua delete mode 100644 plugin-confs/dashboard-art.vim delete mode 100644 plugin-confs/doomone.lua delete mode 100644 plugin-confs/github-theme.lua delete mode 100644 plugin-confs/goto-preview.lua delete mode 100644 plugin-confs/lsp-signature.lua delete mode 100644 plugin-confs/neodev.lua delete mode 100644 plugin-confs/neogit.lua delete mode 100644 plugin-confs/nvim-dap-bash.lua delete mode 100644 plugin-confs/nvim-dap-python.lua delete mode 100644 plugin-confs/nvim-dap-ui.lua delete mode 100644 plugin-confs/nvim-dap-virtual-text.lua delete mode 100644 plugin-confs/nvim-docs-view.lua delete mode 100644 plugin-confs/symbols-outline.lua delete mode 100644 plugin-confs/trouble.lua diff --git a/autocommands.vim b/autocommands.vim deleted file mode 100644 index f6a5895..0000000 --- a/autocommands.vim +++ /dev/null @@ -1,10 +0,0 @@ -" open at last location if possible -if has('autocmd') - au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif -endif - -" open help and man pages in a vertical split -autocmd FileType help wincmd L -autocmd FileType man wincmd L -" make terminal not have line numbers -autocmd TermOpen * setlocal nonumber norelativenumber diff --git a/coc-settings.json b/coc-settings.json deleted file mode 100644 index a8f5c3d..0000000 --- a/coc-settings.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "diagnostic.displayByAle": false, - "diagnostic.enable": true, - "diagnostic.level": "hint", - "diagnostic-languageserver.enable": true, - "diagnostic-languageserver.filetypes": { - "sh": "shellcheck", - "python": "pylint" - }, - "diagnostic-languageserver.mergeConfig": true, - "diagnostic-languageserver.formatFiletypes": { - "sh": "shfmt", - "python": ["black", "isort"] - }, - "diagnostic-languageserver.formatters": { - "shfmt": { - "command": "shfmt", - "args": ["-i", "4", "-ci", "-sr"] - }, - "black": { - "command": "black" - } - }, - "pyright.organizeimports.provider": "isort", - "pyright.completion.importSupport": true, - "pyright.enable": true, - "python.linting.pylintEnabled": true, - "python.linting.pylintPath": "/usr/bin/pylint", - "python.formatting.blackPath": "/usr/bin/black", - "python.analysis.autoSearchPaths": true, - "python.venvPath": "env", - "languageserver": { - "python": { - "command": "pyright", - "filetypes": ["python", "py"] - } - }, - "hover.floatConfig": { - "border": true, - "shadow": true, - "focusable": true, - "highlight": "CocFloating", - "borderhighlight": "CocFloating" - }, - "diagnostic.virtualText": true, - "diagnostic.virtualTextLines": 5, - "diagnostic.virtualTextLevel": "information", - "codeLens.enable": true, - "codeLens.position": "eol" -} diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..1a9a7c3 --- /dev/null +++ b/init.lua @@ -0,0 +1,9 @@ +-- Load core configurations +require('core.options') +require('core.keymaps') +require('core.plugins') +require('core.autocmds') +require('plugins.lsp') +require('plugins.ui') +require('plugins.ai') +require('plugins.colorscheme') diff --git a/init.vim b/init.vim deleted file mode 100755 index 8649414..0000000 --- a/init.vim +++ /dev/null @@ -1,101 +0,0 @@ -if has('autocmd') - au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif -endif - -" open help and man pages in a vertical split -autocmd FileType help wincmd L -autocmd FileType man wincmd L -" make terminal not have line numbers -autocmd TermOpen * setlocal nonumber norelativenumber -" call code actions function -lua require('settings') -lua require('plugins') -source ~/.config/nvim/keybindings.vim - -" nvim plugins -source ~/.config/nvim/plugin-confs/bufferline.lua -" source ~/.config/nvim/plugin-confs/dashboard-art.vim -source ~/.config/nvim/plugin-confs/dashboard-nvim.lua -source ~/.config/nvim/plugin-confs/gitsigns.lua -" source ~/.config/nvim/plugin-confs/lspfuzzy.lua -source ~/.config/nvim/plugin-confs/lualine.lua -source ~/.config/nvim/plugin-confs/copilot-lualine.lua -source ~/.config/nvim/plugin-confs/nvimtree.lua -source ~/.config/nvim/plugin-confs/presence.lua -source ~/.config/nvim/plugin-confs/treesitter.lua -source ~/.config/nvim/plugin-confs/treesitter-context.lua -source ~/.config/nvim/plugin-confs/whichkey.lua -source ~/.config/nvim/plugin-confs/telescope.lua -source ~/.config/nvim/plugin-confs/telescope-file-browser.lua - -source ~/.config/nvim/plugin-confs/goto-preview.lua -source ~/.config/nvim/plugin-confs/lsp-kind.lua -source ~/.config/nvim/plugin-confs/lspconfig.lua -source ~/.config/nvim/plugin-confs/lsplines.lua -source ~/.config/nvim/plugin-confs/null-ls.lua -source ~/.config/nvim/plugin-confs/nvim-cmp.lua -source ~/.config/nvim/plugin-confs/lsp-format.lua -source ~/.config/nvim/plugin-confs/nvim-lint.lua -source ~/.config/nvim/plugin-confs/codecompanion.lua -source ~/.config/nvim/plugin-confs/luasnip.lua -source ~/.config/nvim/plugin-confs/fidget.lua -source ~/.config/nvim/plugin-confs/rainbow-delimiters.lua -" source ~/.config/nvim/plugin-confs/symbols-outline.lua -source ~/.config/nvim/plugin-confs/nvim-colorizer.lua -source ~/.config/nvim/plugin-confs/nvim-dap-python.lua -source ~/.config/nvim/plugin-confs/nvim-dap-bash.lua -source ~/.config/nvim/plugin-confs/nvim-dap-ui.lua -source ~/.config/nvim/plugin-confs/nvim-dap-virtual-text.lua -" source ~/.config/nvim/plugin-confs/copilot.lua -source ~/.config/nvim/plugin-confs/copilot-cmp.lua -source ~/.config/nvim/plugin-confs/nvim-notify.lua -" source ~/.config/nvim/plugin-confs/lsp-signature.lua -" source ~/.config/nvim/plugin-confs/nvim-docs-view.lua - -" source ~/.config/nvim/plugin-confs/neodev.lua - -" nvim and vim plugins -source ~/.vim/plugin-confs/floaterm.vim -source ~/.vim/plugin-confs/fzf.vim -source ~/.vim/plugin-confs/vim-closetag.vim -source ~/.vim/plugin-confs/wakatime.vim - -" source ~/.config/nvim/plugin-confs/doomone.lua -source ~/.config/nvim/plugin-confs/dracula.lua -source ~/.config/nvim/plugin-confs/github-theme.lua -source ~/.config/nvim/plugin-confs/onedarkpro.lua -source ~/.config/nvim/plugin-confs/catppuccin.lua - -" CUSTOM COMMANDS -" command! -bang -nargs=? -complete=dir Files -" \ call fzf#vim#files(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), 0) - -" command! -bang -nargs=? -complete=dir AllFiles -" \ call fzf#run(fzf#wrap('allfiles', fzf#vim#with_preview({'dir': , 'sink': 'e', 'source': 'rg --files --hidden --no-ignore', 'options': ['--layout=reverse', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), 0)) - -" command! -bang -nargs=? -complete=dir Lines -" \ call fzf#vim#lines(, ({'options': ['--layout=reverse']}), 0) - -" command! -bang -nargs=? -complete=dir Buffers -" \ call fzf#vim#buffers(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), 0) - -command! Reload execute "source ~/.config/nvim/init.vim" -command! Config execute ":e ~/.config/nvim/init.vim" -command! Plugins execute ":e ~/.config/nvim/lua/plugins.lua" -command! Keybindings execute ":e ~/.config/nvim/keybindings.vim" -command! Settings execute ":e ~/.config/nvim/lua/settings.lua" -command! Env execute ":Dotenv .env" -command! MakeTags !ctags -R . -command! Ovewrite execute ":w !sudo tee %" -command! PS execute ":PackerSync" - -" set termguicolors -" colorscheme doom-one -" colorscheme onedark -colorscheme catppuccin-macchiato -highlight Pmenu ctermfg=white ctermbg=black gui=NONE guifg=white guibg=#282C34 -highlight PmenuSel guifg=purple guibg=red - -" run code actions on cursor hold if lsp is attached -"autocmd CursorHold,CursorHoldI * lua require('code_action_utils').code_action_listener() -autocmd CursorHold,CursorHoldI * lua if vim.tbl_isempty(vim.lsp.buf_get_clients()) then require('code_action_utils').code_action_listener() end diff --git a/keybindings.vim b/keybindings.vim deleted file mode 100644 index 8fa2ab0..0000000 --- a/keybindings.vim +++ /dev/null @@ -1,198 +0,0 @@ -nmap zz -nmap n nzzzv -nmap N Nzzzv - -" paste visually without yanking to clipboard -xnoremap p "_dP - -" reselect visual selection after indent -vnoremap < >gv - -" move selected line(s) up or down and respect indent -vnoremap J :m '>+1gv=gv -vnoremap K :m '<-2gv=gv - -" search -nnoremap // :Telescope current_buffer_fuzzy_find -nnoremap ?? :Telescope lsp_document_symbols - -" nnoremap Q !!$SHELL -" nnoremap rn :lua vim.lsp.buf.rename() - -nnoremap :bnext -nnoremap :bprev - -nnoremap :wa:FloatermToggle floatterm -tnoremap :FloatermToggle floatterm -tnoremap -tnoremap tt :FloatermToggle split-term -tnoremap tf :FloatermToggle floatterm -tnoremap tp :FloatermToggle ipython -tnoremap tP :FloatermToggle ipython-full -"fix issue with space in terminal leader key -tnoremap - - -nnoremap gA :lua vim.lsp.buf.code_actions() -nnoremap gd :Telescope lsp_definitions -nnoremap gDc :Telescope lsp_implementations -nnoremap gDf :Telescope lsp_definitions -nnoremap gF :edit -nnoremap gT :Telescope lsp_type_definitions -nnoremap gb :Gitsigns blame_line -nnoremap gi :Telescope lsp_implementations -nnoremap gj :Telescope jumplist -nnoremap gl :lua vim.lsp.buf.code_lens() -nnoremap gr :Telescope lsp_references -nnoremap gs :lua vim.lsp.buf.signature_help() - -nnoremap bb :Telescope buffers -nnoremap bk :bdelete -nnoremap bn :bnext -nnoremap bp :bprev - -nnoremap ca :lua vim.lsp.buf.code_action() -nnoremap cA :lua vim.lsp.buf.code_action() -nnoremap cc :CodeCompanionChat -nnoremap ci :CodeCompanion -nnoremap cd :Telescope diagnostics -nnoremap cDn :lua vim.diagnostic.goto_next() -nnoremap cDp :lua vim.diagnostic.goto_prev() -nnoremap cl :lua vim.diagnostic.setloclist() -nnoremap cp :vert Copilot panel -nnoremap Ca :CodeCompanionActions -nnoremap Cc :CodeCompanionChat -nnoremap Cc :CodeCompanionChat -nnoremap Ci :CodeCompanion -nnoremap Ct :CodeCompanionChat Toggle -vnoremap Cc :CodeCompanionChat Add -vnoremap Ce :CodeCompanion /explain -vnoremap Cf :CodeCompanion /fix -vnoremap Cl :CodeCompanion /lsp -vnoremap CT :CodeCompanion /tests - -nnoremap db :lua require("dap").toggle_breakpoint() -nnoremap dc :lua require("dap").continue() -nnoremap di :lua require("dap").step_into() -nnoremap do :lua require("dap").step_over() -nnoremap dO :lua require("dap").step_out() -nnoremap dr :lua require("dap").repl.open() -nnoremap dl :lua require("dap").run_last() -nnoremap dh :lua require("dap.ui.widgets").hover() -nnoremap dp :lua require("dap.ui.widgets").preview() -nnoremap df :lua require('dap.ui.widgets').centered_float(require('dap.ui.widgets').frames) -nnoremap ds :lua require('dap.ui.widgets').centered_float(require('dap.ui.widgets').scopes) -nnoremap dut :lua require("dapui").toggle() -nnoremap duo :lua require("dapui").open() -nnoremap duc :lua require("dapui").close() -nnoremap dPm :lua require("dap-python").test_method() -nnoremap dPc :lua require("dap-python").test_class() -nnoremap dPs :lua require("dap-python").debug_selection() - -vnoremap dh :lua require("dap.ui.widgets").hover() -vnoremap dp :lua require("dap.ui.widgets").preview() -vnoremap dpe :lua require("dapui").eval() - -nnoremap :lua require('dap').step_over() -nnoremap :lua require('dap').step_into() -nnoremap :lua require('dap').step_out() - -nnoremap D :Dotenv .env - -nnoremap ec :e ~/.config/nvim/init.vim -nnoremap ek :e ~/.config/nvim/keybindings.vim -nnoremap ep :e ~/.config/nvim/lua/plugins.lua -nnoremap es :e ~/.config/nvim/lua/settings.lua - -nnoremap fb :Telescope file_browser -nnoremap fc :Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical -nnoremap ff :Telescope find_files -nnoremap fg :Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical -nnoremap fr :Telescope oldfiles - -nnoremap gb :Gitsigns blame_line -nnoremap gc :Telescope git_commits -nnoremap gf :Telescope git_files -nnoremap gg :FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit -nnoremap gP lua require('goto-preview').close_all_win() -nnoremap gR Telescope lsp_references -nnoremap gpc lua require('goto-preview').close_all_win() -nnoremap gpd lua require('goto-preview').goto_preview_definition() -nnoremap gpi lua require('goto-preview').goto_preview_implementation() - -nnoremap hc :Telescope commands -nnoremap hdc :Telescope dap commands -nnoremap hdC :Telescope dap configurations -nnoremap hdb :Telescope dap list_breakpoints -nnoremap hdv :Telescope dap variables -nnoremap hdf :Telescope dap frames -nnoremap hv :Telescope vim_options -nnoremap hk :Telescope keymaps -nnoremap hs :Telescope spell_suggest - -nnoremap isp :-1read $HOME/Templates/python.py4jw - -nnoremap j :AnyJump - -nnoremap K :lua vim.lsp.buf.hover() - -nnoremap ld :Telescope lsp_definitions -nnoremap lD :Telescope diagnostics -nnoremap la :lua vim.lsp.buf.code_action() -nnoremap lci :Telescope lsp_incoming_calls -nnoremap lco :Telescope lsp_outgoing_calls -nnoremap lh :lua vim.lsp.buf.signature_help() -nnoremap li :Telescope lsp_implementations -nnoremap lr :Telescope lsp_references -nnoremap lR :lua vim.lsp.buf.rename() -nnoremap ls :Telescope lsp_document_symbols -nnoremap lt :Telescope lsp_type_definitions -nnoremap lw :Telescope lsp_dynamic_workspace_symbols - -nnoremap n :NvimTreeToggle -" nnoremap r :NvimTreeRefresh - - -nnoremap ob :Telescope file_browser -nnoremap oc :CodeCompanionChat -nnoremap oC :e ~/.config/nvim/init.vim -nnoremap oB :FloatermNew --title=btop --opener=vsplit btop -nnoremap od :FloatermNew --title=lazydocker --opener=vsplit lazydocker -nnoremap of :wa:FloatermToggle floatterm -nnoremap oh :FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=split --position=botright --height=0.45 -nnoremap on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp -nnoremap op :FloatermNew --title=ipython --name=ipython --opener=split --wintype=vsplit --position=botright --width=0.5 ipython -nnoremap oP :FloatermNew --title=ipython-full --name=ipython-full --opener=edit --width=1.0 --height=1.0 ipython -nnoremap or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD" -nnoremap ot :FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=vsplit --position=botright --width=0.5 - -nnoremap sc :nohls -nnoremap sC :Telescope commands -nnoremap sf :Telescope find_files -nnoremap sg :Telescope live_grep -nnoremap sG :Telescope glyph -nnoremap sh :Telescope command_history -nnoremap sm :Telescope man_pages -nnoremap s/ :Telescope search_history - -nnoremap tc :Telescope colorscheme -nnoremap tf :wa:FloatermToggle floatterm -nnoremap tp :FloatermToggle ipython -nnoremap tP :FloatermToggle ipython-full -nnoremap tt :FloatermToggle split-term -nnoremap td :DBUIToggle -nnoremap tc :CodeCompanionChat Toggle -nnoremap Tc :Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical -nnoremap Tg :Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical -nnoremap Tn :Telescope notify -nnoremap Tt :Telescope - -nnoremap wa :lua vim.lsp.buf.add_workspace_folder() -nnoremap wl :lua print(vim.inspect(vim.lsp.buf.list_workspace_folders())) -nnoremap wr :lua vim.lsp.buf.remove_workspace_folder() - -nmap x !chmod +x % - -nnoremap y "+ -vmap y "+ diff --git a/lua/code_action_utils.lua b/lua/code_action_utils.lua deleted file mode 100644 index 4fea507..0000000 --- a/lua/code_action_utils.lua +++ /dev/null @@ -1,15 +0,0 @@ -local M = {} - -local lsp_util = vim.lsp.util - -function M.code_action_listener() - local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() } - local params = lsp_util.make_range_params() - params.context = context - vim.lsp.buf_request(0, 'textDocument/codeAction', params, - function(err, result, ctx, config) - -- do something with result - e.g. check if empty and show some indication such as a sign - end) -end - -return M diff --git a/lua/core/autocmds.lua b/lua/core/autocmds.lua new file mode 100644 index 0000000..381db4f --- /dev/null +++ b/lua/core/autocmds.lua @@ -0,0 +1,51 @@ +local augroup = vim.api.nvim_create_augroup +local autocmd = vim.api.nvim_create_autocmd + +-- Restore cursor position +local restore_cursor = augroup('RestoreCursor', { clear = true }) +autocmd('BufReadPost', { + group = restore_cursor, + callback = function() + local mark = vim.api.nvim_buf_get_mark(0, '"') + local lcount = vim.api.nvim_buf_line_count(0) + if mark[1] > 0 and mark[1] <= lcount then + pcall(vim.api.nvim_win_set_cursor, 0, mark) + end + end, +}) + +-- Help and man pages in vertical split +local help_config = augroup('HelpConfig', { clear = true }) +autocmd('FileType', { + group = help_config, + pattern = { 'help', 'man' }, + command = 'wincmd L' +}) + +-- Terminal settings +local term_config = augroup('TermConfig', { clear = true }) +autocmd('TermOpen', { + group = term_config, + pattern = '*', + command = 'setlocal nonumber norelativenumber' +}) + +local highlight_yank = augroup('HighlightYank', { clear = true }) +autocmd('TextYankPost', { + group = highlight_yank, + pattern = '*', + callback = function() + vim.highlight.on_yank({ higroup = "IncSearch", timeout = 1000 }) + end, +}) + +-- Code actions on cursor hold +-- local code_action = augroup('CodeAction', { clear = true }) +-- autocmd({ 'CursorHold', 'CursorHoldI' }, { +-- group = code_action, +-- callback = function() +-- if vim.tbl_isempty(vim.lsp.buf_get_clients()) then +-- require('code_action_utils').code_action_listener() +-- end +-- end +-- }) \ No newline at end of file diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua new file mode 100644 index 0000000..ed92783 --- /dev/null +++ b/lua/core/keymaps.lua @@ -0,0 +1,158 @@ +local map = vim.keymap.set +local opts = { silent = true, noremap = true } + +-- Leader key +vim.g.mapleader = " " +vim.g.maplocalleader = "," + +-- Custom commands +vim.api.nvim_create_user_command('PS', ':PackerSync', {}) +vim.api.nvim_create_user_command('Reload', 'source ~/.config/nvim/init.lua', {}) +vim.api.nvim_create_user_command('Config', 'edit ~/.config/nvim/init.lua', {}) +vim.api.nvim_create_user_command('Plugins', 'edit ~/.config/nvim/lua/core/plugins.lua', {}) +vim.api.nvim_create_user_command('Keymaps', 'edit ~/.config/nvim/lua/core/keymaps.lua', {}) + +-- Basic mappings +map('n', '', 'zz', opts) +map('n', 'n', 'nzzzv', opts) +map('n', 'N', 'Nzzzv', opts) +map('x', 'p', '"_dP', opts) -- paste without yanking +map('v', '<', '', '>gv', opts) +map('v', 'J', ":m '>+1gv=gv", opts) -- move lines +map('v', 'K', ":m '<-2gv=gv", opts) + +-- Buffer navigation +map('n', '', ':bnext', opts) +map('n', '', ':bprev', opts) +map('n', 'bb', ':Telescope buffers', opts) +map('n', 'bk', ':bdelete', opts) +map('n', 'bn', ':bnext', opts) +map('n', 'bp', ':bprev', opts) + +-- Terminal mappings +map('n', '', ':wa:FloatermToggle floatterm', opts) +map('t', '', ':FloatermToggle floatterm', opts) +map('t', '', '', opts) +map('n', 'tt', ':FloatermToggle split-term', opts) +map('t', 'tt', ':FloatermToggle split-term', opts) +map('t', 'tf', ':FloatermToggle floatterm', opts) +map('t', 'tp', ':FloatermToggle ipython', opts) +map('t', 'tP', ':FloatermToggle ipython-full', opts) +map('t', '', '', opts) -- fix space in terminal + +-- LSP mappings +map('n', 'gA', vim.lsp.buf.code_action, opts) +map('n', 'gd', ':Telescope lsp_definitions', opts) +map('n', 'gDc', ':Telescope lsp_implementations', opts) +map('n', 'gDf', ':Telescope lsp_definitions', opts) +map('n', 'gF', ':edit ', opts) +map('n', 'gT', ':Telescope lsp_type_definitions', opts) +map('n', 'gb', ':Gitsigns blame_line', opts) +map('n', 'gi', ':Telescope lsp_implementations', opts) +map('n', 'gj', ':Telescope jumplist', opts) +map('n', 'gl', vim.lsp.codelens.run, opts) +map('n', 'gr', ':Telescope lsp_references', opts) +map('n', 'gs', vim.lsp.buf.signature_help, opts) +map('n', 'K', vim.lsp.buf.hover, opts) + +-- Code Companion and Copilot +map('n', 'cc', ':CodeCompanionChat', opts) +map('n', 'ci', ':CodeCompanion ', opts) +map('n', 'cp', ':vert Copilot panel', opts) +map('n', 'Ca', ':CodeCompanionActions', opts) +map('v', 'Cc', ':CodeCompanionChat Add', opts) +map('v', 'Ce', ':CodeCompanion /explain', opts) +map('v', 'Cf', ':CodeCompanion /fix', opts) +map('v', 'Cl', ':CodeCompanion /lsp', opts) +map('v', 'CT', ':CodeCompanion /tests', opts) + +-- Telescope mappings +map('n', '//', ':Telescope current_buffer_fuzzy_find', opts) +map('n', '??', ':Telescope lsp_document_symbols', opts) +map('n', 'fc', + ':Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical', + opts) +map('n', 'ff', ':Telescope find_files', opts) +map('n', 'sf', ':Telescope find_files', opts) +map('n', 'fg', ':Telescope live_grep', opts) +map('n', 'fG', + ':Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical', + opts) +map('n', 'fb', ':Telescope file_browser', opts) +map('n', 'fr', ':Telescope oldfiles', opts) + +-- File explorer and tools +map('n', 'n', ':NvimTreeToggle', opts) +map('n', 'D', ':Dotenv .env', opts) + +-- Git mappings +map('n', 'gg', ':FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit', opts) +map('n', 'gc', ':Telescope git_commits', opts) +map('n', 'gf', ':Telescope git_files', opts) + +-- Misc utilities +map('n', 'x', '!chmod +x %', opts) +map('n', 'y', '"+', opts) +map('v', 'y', '"+', opts) + +-- Terminal applications +map('n', 'oB', ':FloatermNew --title=btop --opener=vsplit btop', opts) +map('n', 'od', ':FloatermNew --title=lazydocker --opener=vsplit --width=0.75 --height=0.75 lazydocker', opts) +map('n', 'on', ':FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp --width=1 --height=1', opts) +map('n', 'or', ':FloatermNew --title=ranger --opener=vsplit --width=1.0 --height=1.0 ranger --cmd="cd $PWD"', + opts) + +map('n', "gpc", ':lua require("goto-preview").close_all_win()') +map('n', "gpd", ':lua require("goto-preview").goto_preview_definition()') +map('n', "gpi", ':lua require("goto-preview").goto_preview_implementation()') + +-- Workspace management +map('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) +map('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) +map('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) +end, opts) + +-- Helper +map('n', 'hc', ':Telescope commands') +map('n', 'hv', ':Telescope vim_options') +map('n', 'hk', ':Telescope keymaps') +map('n', 'hs', ':Telescope spell_suggest') +map('n', 'hm', ':Telescope man_pages') + +-- LSP +map('n', 'ld', ':Telescope lsp_definitions') +map('n', 'lD', ':Telescope diagnostic') +map('n', 'la', ':lua vim.lsp.buf.code_action()') +map('n', 'lci', ':Telescope lsp_incoming_calls') +map('n', 'lco', ':Telescope lsp_outgoing_calls') +map('n', 'lh', ':lua vim.lsp.buf.signature_help()') +map('n', 'li', ':Telescope lsp_implementations') +map('n', 'lr', ':Telescope lsp_references') +map('n', 'lR', ':lua vim.lsp.buf.rename()') +map('n', 'ls', ':Telescope lsp_document_symbols') +map('n', 'lt', ':Telescope lsp_type_definitions') +map('n', 'lw', ':Telescope lsp_dynamic_workspace_symbols') + + +map('n', 'ob', ':Telescope file_browser') +map('n', 'ot', + ':FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=vsplit --position=botright --width=0.5') +map('n', 'oh', + ':FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=split --position=botright --height=0.45') +map('n', 'op', + ':FloatermNew --title=ipython --name=ipython --opener=split --wintype=vsplit --position=botright --width=0.5 ipython') +map('n', 'oP', + ':FloatermNew --title=ipython-full --name=ipython-full --opener=edit --width=1.0 --height=1.0 ipython') + +map('n', 'oc', ':CodeCompanionChat') +map('n', 'of', ':FloatermToggle floatterm') + +map('n', 'sc', ':nohls') +map('n', 'sf', ':Telescope find_files') +map('n', 'sg', ':Telescope live_grep') +map('n', 'sh', ':Telescope command_history') +map('n', 'sm', ':Telescope man_pages') +map('n', 's/', ':Telescope search_history') +map('n', 'sc', ':nohls') diff --git a/lua/settings.lua b/lua/core/options.lua similarity index 100% rename from lua/settings.lua rename to lua/core/options.lua diff --git a/lua/plugins.lua b/lua/core/plugins.lua similarity index 74% rename from lua/plugins.lua rename to lua/core/plugins.lua index 25efe98..8171068 100644 --- a/lua/plugins.lua +++ b/lua/core/plugins.lua @@ -27,69 +27,7 @@ require('packer').startup(function(use) -- }}} -- LSP/DEV {{{ - - -- COPILOT {{{ - use { - "zbirenbaum/copilot.lua", - event = "VimEnter", - config = function() - require('copilot').setup({ - panel = { - enabled = false, - auto_refresh = false, - keymap = { - jump_prev = "[[", - jump_next = "]]", - accept = "", - refresh = "gr", - open = "" - }, - layout = { - position = "right", -- | top | left | right - ratio = 0.4 - } - }, - suggestion = { - enabled = false, - auto_trigger = false, - debounce = 75, - keymap = { - accept = "", - -- accept = "", - next = "", - prev = "", - dismiss = "" - } - }, - -- filetypes = { - -- yaml = false, - -- markdown = false, - -- help = false, - -- gitcommit = false, - -- gitrebase = false, - -- hgcommit = false, - -- svn = false, - -- cvs = false, - -- ["."] = false, - -- }, - copilot_node_command = 'node', -- Node version must be < 18 - plugin_manager_path = vim.fn.stdpath("data") .. - "/site/pack/packer", - server_opts_overrides = { - trace = "verbose", - settings = { - advanced = { - listCount = 10, -- #completions for panel - inlineSuggestCount = 4 -- #completions for getCompletions - } - } - } - }) - end - } - use { "zbirenbaum/copilot-cmp" } - -- }}} use({ "olimorris/codecompanion.nvim", @@ -131,15 +69,11 @@ require('packer').startup(function(use) use { 'lukas-reineke/lsp-format.nvim' } use 'mfussenegger/nvim-lint' - -- DAP {{{ - - use 'mfussenegger/nvim-dap' use 'nvim-neotest/nvim-nio' - use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } } - use { 'mfussenegger/nvim-dap-python' } - use { 'theHamsta/nvim-dap-virtual-text' } - - -- }}} + -- use 'mfussenegger/nvim-dap' + -- use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } } + -- use { 'mfussenegger/nvim-dap-python' } + -- use { 'theHamsta/nvim-dap-virtual-text' } -- DADBOD {{{ diff --git a/lua/keybindings.lua b/lua/keybindings.lua deleted file mode 100644 index 3b9122d..0000000 --- a/lua/keybindings.lua +++ /dev/null @@ -1,3 +0,0 @@ -local function map(m, k, v) - vim.keymap.set(m, k, v, { silent = true, noremap = true }) -end diff --git a/plugin-confs/codecompanion.lua b/lua/plugins/ai/codecompanion.lua similarity index 100% rename from plugin-confs/codecompanion.lua rename to lua/plugins/ai/codecompanion.lua diff --git a/lua/codecompanion/fidget-spinner.lua b/lua/plugins/ai/codecompanion/fidget-spinner.lua similarity index 100% rename from lua/codecompanion/fidget-spinner.lua rename to lua/plugins/ai/codecompanion/fidget-spinner.lua diff --git a/lua/plugins/ai/init.lua b/lua/plugins/ai/init.lua new file mode 100644 index 0000000..e75e650 --- /dev/null +++ b/lua/plugins/ai/init.lua @@ -0,0 +1 @@ +require("plugins.ai.codecompanion") \ No newline at end of file diff --git a/plugin-confs/catppuccin.lua b/lua/plugins/colorscheme/catppuccin.lua similarity index 100% rename from plugin-confs/catppuccin.lua rename to lua/plugins/colorscheme/catppuccin.lua diff --git a/plugin-confs/dracula.lua b/lua/plugins/colorscheme/dracula.lua similarity index 100% rename from plugin-confs/dracula.lua rename to lua/plugins/colorscheme/dracula.lua diff --git a/lua/plugins/colorscheme/init.lua b/lua/plugins/colorscheme/init.lua new file mode 100644 index 0000000..335c51a --- /dev/null +++ b/lua/plugins/colorscheme/init.lua @@ -0,0 +1,3 @@ +require("plugins.colorscheme.catppuccin") +require("plugins.colorscheme.dracula") +require("plugins.colorscheme.onedarkpro") \ No newline at end of file diff --git a/plugin-confs/onedarkpro.lua b/lua/plugins/colorscheme/onedarkpro.lua similarity index 100% rename from plugin-confs/onedarkpro.lua rename to lua/plugins/colorscheme/onedarkpro.lua diff --git a/plugin-confs/copilot-cmp.lua b/lua/plugins/lsp/copilot-cmp.lua similarity index 100% rename from plugin-confs/copilot-cmp.lua rename to lua/plugins/lsp/copilot-cmp.lua diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua new file mode 100644 index 0000000..308a331 --- /dev/null +++ b/lua/plugins/lsp/init.lua @@ -0,0 +1,10 @@ +require('plugins.lsp.copilot-cmp') +require('plugins.lsp.lsp-format') +require('plugins.lsp.lsp-kind') +require('plugins.lsp.lspconfig') +-- require('plugins.lsp.lspfuzzy') +require('plugins.lsp.lsplines') +require('plugins.lsp.luasnip') +require('plugins.lsp.null-ls') +require('plugins.lsp.nvim-cmp') +require('plugins.lsp.nvim-lint') \ No newline at end of file diff --git a/plugin-confs/lsp-format.lua b/lua/plugins/lsp/lsp-format.lua similarity index 100% rename from plugin-confs/lsp-format.lua rename to lua/plugins/lsp/lsp-format.lua diff --git a/plugin-confs/lsp-kind.lua b/lua/plugins/lsp/lsp-kind.lua similarity index 100% rename from plugin-confs/lsp-kind.lua rename to lua/plugins/lsp/lsp-kind.lua diff --git a/plugin-confs/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua similarity index 100% rename from plugin-confs/lspconfig.lua rename to lua/plugins/lsp/lspconfig.lua diff --git a/plugin-confs/lspfuzzy.lua b/lua/plugins/lsp/lspfuzzy.lua similarity index 100% rename from plugin-confs/lspfuzzy.lua rename to lua/plugins/lsp/lspfuzzy.lua diff --git a/plugin-confs/lsplines.lua b/lua/plugins/lsp/lsplines.lua similarity index 100% rename from plugin-confs/lsplines.lua rename to lua/plugins/lsp/lsplines.lua diff --git a/plugin-confs/luasnip.lua b/lua/plugins/lsp/luasnip.lua similarity index 100% rename from plugin-confs/luasnip.lua rename to lua/plugins/lsp/luasnip.lua diff --git a/plugin-confs/null-ls.lua b/lua/plugins/lsp/null-ls.lua similarity index 100% rename from plugin-confs/null-ls.lua rename to lua/plugins/lsp/null-ls.lua diff --git a/plugin-confs/nvim-cmp.lua b/lua/plugins/lsp/nvim-cmp.lua similarity index 100% rename from plugin-confs/nvim-cmp.lua rename to lua/plugins/lsp/nvim-cmp.lua diff --git a/plugin-confs/nvim-lint.lua b/lua/plugins/lsp/nvim-lint.lua similarity index 100% rename from plugin-confs/nvim-lint.lua rename to lua/plugins/lsp/nvim-lint.lua diff --git a/plugin-confs/bufferline.lua b/lua/plugins/ui/bufferline.lua similarity index 100% rename from plugin-confs/bufferline.lua rename to lua/plugins/ui/bufferline.lua diff --git a/plugin-confs/copilot-lualine.lua b/lua/plugins/ui/copilot-lualine.lua similarity index 100% rename from plugin-confs/copilot-lualine.lua rename to lua/plugins/ui/copilot-lualine.lua diff --git a/plugin-confs/dashboard-nvim.lua b/lua/plugins/ui/dashboard-nvim.lua similarity index 100% rename from plugin-confs/dashboard-nvim.lua rename to lua/plugins/ui/dashboard-nvim.lua diff --git a/plugin-confs/fidget.lua b/lua/plugins/ui/fidget.lua similarity index 100% rename from plugin-confs/fidget.lua rename to lua/plugins/ui/fidget.lua diff --git a/plugin-confs/git-blame.lua b/lua/plugins/ui/git-blame.lua similarity index 100% rename from plugin-confs/git-blame.lua rename to lua/plugins/ui/git-blame.lua diff --git a/plugin-confs/gitsigns.lua b/lua/plugins/ui/gitsigns.lua similarity index 100% rename from plugin-confs/gitsigns.lua rename to lua/plugins/ui/gitsigns.lua diff --git a/lua/plugins/ui/init.lua b/lua/plugins/ui/init.lua new file mode 100644 index 0000000..15d4e71 --- /dev/null +++ b/lua/plugins/ui/init.lua @@ -0,0 +1,17 @@ +require('plugins.ui.bufferline') +require('plugins.ui.copilot-lualine') +require('plugins.ui.dashboard-nvim') +require('plugins.ui.fidget') +-- require('plugins.ui.git-blame') +require('plugins.ui.gitsigns') +require('plugins.ui.lualine') +require('plugins.ui.nvim-colorizer') +require('plugins.ui.nvim-notify') +require('plugins.ui.nvimtree') +require('plugins.ui.presence') +require('plugins.ui.rainbow-delimiters') +require('plugins.ui.telescope-file-browser') +require('plugins.ui.telescope') +require('plugins.ui.treesitter-context') +require('plugins.ui.treesitter') +require('plugins.ui.whichkey') diff --git a/plugin-confs/lualine.lua b/lua/plugins/ui/lualine.lua similarity index 100% rename from plugin-confs/lualine.lua rename to lua/plugins/ui/lualine.lua diff --git a/plugin-confs/nvim-colorizer.lua b/lua/plugins/ui/nvim-colorizer.lua similarity index 100% rename from plugin-confs/nvim-colorizer.lua rename to lua/plugins/ui/nvim-colorizer.lua diff --git a/plugin-confs/nvim-notify.lua b/lua/plugins/ui/nvim-notify.lua similarity index 100% rename from plugin-confs/nvim-notify.lua rename to lua/plugins/ui/nvim-notify.lua diff --git a/plugin-confs/nvimtree.lua b/lua/plugins/ui/nvimtree.lua similarity index 100% rename from plugin-confs/nvimtree.lua rename to lua/plugins/ui/nvimtree.lua diff --git a/plugin-confs/presence.lua b/lua/plugins/ui/presence.lua similarity index 100% rename from plugin-confs/presence.lua rename to lua/plugins/ui/presence.lua diff --git a/plugin-confs/rainbow-delimiters.lua b/lua/plugins/ui/rainbow-delimiters.lua similarity index 100% rename from plugin-confs/rainbow-delimiters.lua rename to lua/plugins/ui/rainbow-delimiters.lua diff --git a/plugin-confs/telescope-file-browser.lua b/lua/plugins/ui/telescope-file-browser.lua similarity index 100% rename from plugin-confs/telescope-file-browser.lua rename to lua/plugins/ui/telescope-file-browser.lua diff --git a/plugin-confs/telescope.lua b/lua/plugins/ui/telescope.lua similarity index 98% rename from plugin-confs/telescope.lua rename to lua/plugins/ui/telescope.lua index 8ae9869..a58f061 100644 --- a/plugin-confs/telescope.lua +++ b/lua/plugins/ui/telescope.lua @@ -60,7 +60,7 @@ ts.setup({ } }) -ts.load_extension('dap') +-- ts.load_extension('dap') ts.load_extension('fzf') ts.load_extension('glyph') ts.load_extension('color_names') diff --git a/plugin-confs/treesitter-context.lua b/lua/plugins/ui/treesitter-context.lua similarity index 100% rename from plugin-confs/treesitter-context.lua rename to lua/plugins/ui/treesitter-context.lua diff --git a/plugin-confs/treesitter.lua b/lua/plugins/ui/treesitter.lua similarity index 100% rename from plugin-confs/treesitter.lua rename to lua/plugins/ui/treesitter.lua diff --git a/plugin-confs/whichkey.lua b/lua/plugins/ui/whichkey.lua similarity index 100% rename from plugin-confs/whichkey.lua rename to lua/plugins/ui/whichkey.lua diff --git a/lua/toggle_lsp_diagnostics.lua b/lua/toggle_lsp_diagnostics.lua deleted file mode 100644 index 4c042c4..0000000 --- a/lua/toggle_lsp_diagnostics.lua +++ /dev/null @@ -1,11 +0,0 @@ -local diagnostics_active = true -local toggle_diagnostics = function() - diagnostics_active = not diagnostics_active - if diagnostics_active then - vim.diagnostic.show() - else - vim.diagnostic.hide() - end -end - -vim.keymap.set('n', 'td', toggle_diagnostics) diff --git a/plugin-confs/chatgpt.lua b/plugin-confs/chatgpt.lua deleted file mode 100644 index 8b13789..0000000 --- a/plugin-confs/chatgpt.lua +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugin-confs/code_actions.lua b/plugin-confs/code_actions.lua deleted file mode 100644 index 1d24ff5..0000000 --- a/plugin-confs/code_actions.lua +++ /dev/null @@ -1,14 +0,0 @@ -local M = {} - -local lsp_util = vim.lsp.util - -function M.code_action_listener() - local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() } - local params = lsp_util.make_range_params() - params.context = context - vim.lsp.buf_request(0, 'textDocument/codeAction', params, function(err, _, result) - -- do something with result - e.g. check if empty and show some indication such as a sign - end) -end - -return M diff --git a/plugin-confs/copilot.lua b/plugin-confs/copilot.lua deleted file mode 100644 index 8b13789..0000000 --- a/plugin-confs/copilot.lua +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugin-confs/dashboard-art.vim b/plugin-confs/dashboard-art.vim deleted file mode 100644 index 4cdd9bb..0000000 --- a/plugin-confs/dashboard-art.vim +++ /dev/null @@ -1,8 +0,0 @@ -let g:dashboard_custom_header = [ -\ ' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗', -\ ' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║', -\ ' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║', -\ ' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║', -\ ' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║', -\ ' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝', -\] diff --git a/plugin-confs/doomone.lua b/plugin-confs/doomone.lua deleted file mode 100644 index 0e11b3e..0000000 --- a/plugin-confs/doomone.lua +++ /dev/null @@ -1,57 +0,0 @@ --- require('doom-one').setup({ --- cursor_coloring = false, --- terminal_colors = false, --- italic_comments = false, --- enable_treesitter = true, --- transparent_background = false, --- pumblend = { --- enable = true, --- transparency_amount = 20, --- }, --- plugins_integrations = { --- neorg = true, --- barbar = true, --- bufferline = false, --- gitgutter = false, --- gitsigns = true, --- telescope = false, --- neogit = true, --- nvim_tree = true, --- dashboard = true, --- startify = true, --- whichkey = true, --- indent_blankline = true, --- vim_illuminate = true, --- lspsaga = false, --- }, --- }) - - -vim.g.doom_one_cursor_coloring = true --- Set :terminal colors -vim.g.doom_one_terminal_colors = true --- Enable italic comments -vim.g.doom_one_italic_comments = false --- Enable TS support -vim.g.doom_one_enable_treesitter = true --- Color whole diagnostic text or only underline -vim.g.doom_one_diagnostics_text_color = true --- Enable transparent background -vim.g.doom_one_transparent_background = false - --- Pumblend transparency -vim.g.doom_one_pumblend_enable = false -vim.g.doom_one_pumblend_transparency = 20 - --- Plugins integration -vim.g.doom_one_plugin_neorg = true -vim.g.doom_one_plugin_barbar = false -vim.g.doom_one_plugin_telescope = false -vim.g.doom_one_plugin_neogit = true -vim.g.doom_one_plugin_nvim_tree = true -vim.g.doom_one_plugin_dashboard = true -vim.g.doom_one_plugin_startify = true -vim.g.doom_one_plugin_whichkey = true -vim.g.doom_one_plugin_indent_blankline = true -vim.g.doom_one_plugin_vim_illuminate = true -vim.g.doom_one_plugin_lspsaga = false diff --git a/plugin-confs/github-theme.lua b/plugin-confs/github-theme.lua deleted file mode 100644 index dc64e7a..0000000 --- a/plugin-confs/github-theme.lua +++ /dev/null @@ -1,19 +0,0 @@ --- Example config in Lua -require("github-theme").setup({ - -- theme_style = "dark", - -- function_style = "italic", - -- sidebars = {"qf", "vista_kind", "terminal", "packer"}, - - -- -- Change the "hint" color to the "orange" color, and make the "error" color bright red - -- colors = {hint = "orange", error = "#ff0000"}, - - -- -- Overwrite the highlight groups - -- overrides = function(c) - -- return { - -- htmlTag = {fg = c.red, bg = "#282c34", sp = c.hint, style = "underline"}, - -- DiagnosticHint = {link = "LspDiagnosticsDefaultHint"}, - -- -- this will remove the highlight groups - -- TSField = {}, - -- } - -- end -}) diff --git a/plugin-confs/goto-preview.lua b/plugin-confs/goto-preview.lua deleted file mode 100644 index 8309252..0000000 --- a/plugin-confs/goto-preview.lua +++ /dev/null @@ -1,19 +0,0 @@ -require('goto-preview').setup { - width = 120; -- Width of the floating window - height = 20; -- Height of the floating window - border = {"╭", "─" ,"╮", "│", "╯", "─", "╰", "│"}; -- Border characters of the floating window - -- border = {"┌", "─" ,"┐", "│", "┘", "─", "└", "│"}; -- Border characters of the floating window - default_mappings = false; -- Bind default mappings - debug = false; -- Print debug information - opacity = 25; -- 0-100 opacity level of the floating window where 100 is fully transparent. - resizing_mappings = false; -- Binds arrow keys to resizing the floating window. - post_open_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook. - references = { -- Configure the telescope UI for slowing the references cycling window. - -- telescope = telescope.themes.get_dropdown({ hide_preview = false }) - }; - -- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality. - focus_on_open = true; -- Focus the floating window when opening it. - dismiss_on_move = false; -- Dismiss the floating window when moving the cursor. - force_close = false, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close - bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden -} diff --git a/plugin-confs/lsp-signature.lua b/plugin-confs/lsp-signature.lua deleted file mode 100644 index a544d18..0000000 --- a/plugin-confs/lsp-signature.lua +++ /dev/null @@ -1,47 +0,0 @@ -cfg = { - debug = false, -- set to true to enable debug logging - log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on - -- default is ~/.cache/nvim/lsp_signature.log - verbose = false, -- show debug line number - - bind = true, -- This is mandatory, otherwise border config won't get registered. - -- If you want to hook lspsaga or other signature handler, pls set to false - doc_lines = 15, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated); - -- set to 0 if you DO NOT want any API comments be shown - -- This setting only take effect in insert mode, it does not affect signature help in normal - -- mode, 10 by default - - floating_window = true, -- show hint in a floating window, set to false for virtual text only mode - floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note: - -- will set to true when fully tested, set to false will use whichever side has more space - -- this setting will be helpful if you do not want the PUM and floating win overlap - floating_window_off_x = 0, -- adjust float windows x position. - floating_window_off_y = -1, -- adjust float windows y position. - fix_pos = true, -- trueset to true, the floating window will not auto-close until finish all parameters - hint_enable = false, -- virtual hint enable - hint_prefix = " ", -- Panda for parameter - hint_scheme = "String", - hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight - max_height = 15, -- max height of signature floating_window, if content is more than max_height, you can scroll down - max_width = 85, -- max_width of signature floating_window, line will be wrapped if exceed max_width - handler_opts = { - border = "rounded" -- double, rounded, single, shadow, none - }, - always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58 - auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil. - extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} - zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom - padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc - transparency = nil, -- disabled by default, allow floating win transparent value 1~100 - shadow_blend = 36, -- if you using shadow as border use this set the opacity - shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315' - timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency - toggle_key = nil -- toggle signature on and off in insert mode, e.g. toggle_key = '' -} - --- recommended: -require 'lsp_signature'.setup(cfg) -- no need to specify bufnr if you don't use toggle_key - --- You can also do this inside lsp on_attach --- note: on_attach deprecated --- require'lsp_signature'.on_attach(cfg, bufnr) -- no need to specify bufnr if you don't use toggle_key diff --git a/plugin-confs/neodev.lua b/plugin-confs/neodev.lua deleted file mode 100644 index f1f8ec7..0000000 --- a/plugin-confs/neodev.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("neodev").setup({ - -- add any options here, or leave empty to use the default settings -}) diff --git a/plugin-confs/neogit.lua b/plugin-confs/neogit.lua deleted file mode 100644 index d7e0e0e..0000000 --- a/plugin-confs/neogit.lua +++ /dev/null @@ -1,73 +0,0 @@ -local neogit = require("neogit") - -neogit.setup { - disable_signs = false, - disable_hint = false, - disable_context_highlighting = false, - disable_commit_confirmation = false, - auto_refresh = true, - disable_builtin_notifications = false, - use_magit_keybindings = false, - commit_popup = { - kind = "split", - }, - -- Change the default way of opening neogit - kind = "tab", - -- kind = "vsplit", - -- customize displayed signs - signs = { - -- { CLOSED, OPENED } - section = { ">", "v" }, - item = { ">", "v" }, - hunk = { "", "" }, - }, - integrations = { - -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. - -- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`. - -- - -- Requires you to have `sindrets/diffview.nvim` installed. - -- use { - -- 'TimUntersberger/neogit', - -- requires = { - -- 'nvim-lua/plenary.nvim', - -- 'sindrets/diffview.nvim' - -- } - -- } - -- - diffview = false - }, - -- Setting any section to `false` will make the section not render at all - sections = { - untracked = { - folded = false - }, - unstaged = { - folded = false - }, - staged = { - folded = false - }, - stashes = { - folded = true - }, - unpulled = { - folded = true - }, - unmerged = { - folded = false - }, - recent = { - folded = true - }, - }, - -- override/add mappings - mappings = { - -- modify status buffer mappings - status = { - -- Adds a mapping with "B" as key that does the "BranchPopup" command - ["B"] = "BranchPopup", - -- Removes the default mapping of "s" - ["s"] = "", - } - } -} diff --git a/plugin-confs/nvim-dap-bash.lua b/plugin-confs/nvim-dap-bash.lua deleted file mode 100644 index 7e5cac8..0000000 --- a/plugin-confs/nvim-dap-bash.lua +++ /dev/null @@ -1,31 +0,0 @@ -local dap = require('dap') -dap.adapters.bashdb = { - type = 'executable', - command = vim.fn.stdpath("data") .. - '/mason/packages/bash-debug-adapter/bash-debug-adapter', - name = 'bashdb' -} - -dap.configurations.sh = { - { - type = 'bashdb', - request = 'launch', - name = "Launch file", - showDebugOutput = true, - pathBashdb = vim.fn.stdpath("data") .. - '/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb', - pathBashdbLib = vim.fn.stdpath("data") .. - '/mason/packages/bash-debug-adapter/extension/bashdb_dir', - trace = true, - file = "${file}", - program = "${file}", - cwd = '${workspaceFolder}', - pathCat = "cat", - pathBash = "/bin/bash", - pathMkfifo = "mkfifo", - pathPkill = "pkill", - args = {}, - env = {}, - terminalKind = "integrated" - } -} diff --git a/plugin-confs/nvim-dap-python.lua b/plugin-confs/nvim-dap-python.lua deleted file mode 100644 index 9085c73..0000000 --- a/plugin-confs/nvim-dap-python.lua +++ /dev/null @@ -1,51 +0,0 @@ -local dp = require('dap-python') -dp.test_runner = 'pytest' - --- local dap = require('dap') --- dap.adapters.python = function(cb, config) --- if config.request == 'attach' then --- ---@diagnostic disable-next-line: undefined-field --- local port = (config.connect or config).port --- ---@diagnostic disable-next-line: undefined-field --- local host = (config.connect or config).host or '127.0.0.1' --- cb({ --- type = 'server', --- port = assert(port, --- '`connect.port` is required for a python `attach` configuration'), --- host = host, --- options = { source_filetype = 'python' } --- }) --- else --- cb({ --- type = 'executable', --- command = '/home/sudacode/Projects/Python/debugpy/env/bin/python', --- args = { '-m', 'debugpy.adapter' }, --- options = { source_filetype = 'python' } --- }) --- end --- end --- dap.configurations.python = { --- { --- -- The first three options are required by nvim-dap --- type = 'python', -- the type here established the link to the adapter definition: `dap.adapters.python` --- request = 'launch', --- name = "Launch file", - --- -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options - --- program = "${file}", -- This configuration will launch the current file if used. --- pythonPath = function() --- -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself. --- -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within. --- -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable. --- local cwd = vim.fn.getcwd() --- if vim.fn.executable(cwd .. '/env/bin/python') == 1 then --- return cwd .. '/env/bin/python' --- elseif vim.fn.executable(cwd .. '/.env/bin/python') == 1 then --- return cwd .. '/.env/bin/python' --- else --- return '/usr/bin/python' --- end --- end --- } --- } diff --git a/plugin-confs/nvim-dap-ui.lua b/plugin-confs/nvim-dap-ui.lua deleted file mode 100644 index c5dc318..0000000 --- a/plugin-confs/nvim-dap-ui.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("dapui").setup() --- local dap, dapui = require("dap"), require("dapui") --- dap.listeners.after.event_initialized["dapui_config"] = --- function() dapui.open() end --- dap.listeners.before.event_terminated["dapui_config"] = --- function() dapui.close() end --- dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end diff --git a/plugin-confs/nvim-dap-virtual-text.lua b/plugin-confs/nvim-dap-virtual-text.lua deleted file mode 100644 index 20b3015..0000000 --- a/plugin-confs/nvim-dap-virtual-text.lua +++ /dev/null @@ -1,34 +0,0 @@ -local opts = { - enabled = true, -- enable this plugin (the default) - enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination) - highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText - highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables) - show_stop_reason = true, -- show stop reason when stopped for exceptions - commented = false, -- prefix virtual text with comment string - only_first_definition = true, -- only show virtual text at first definition (if there are multiple) - all_references = false, -- show virtual text on all all references of the variable (not only definitions) - clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping) - --- A callback that determines how a variable is displayed or whether it should be omitted - --- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable - --- @param buf number - --- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame - --- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`) - --- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text - --- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed - display_callback = function(variable, buf, stackframe, node, options) - if options.virt_text_pos == 'inline' then - return ' = ' .. variable.value - else - return variable.name .. ' = ' .. variable.value - end - end, - -- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line - virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol', - - -- experimental features: - all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine. - virt_lines = false, -- show virtual lines instead of virtual text (will flicker!) - virt_text_win_col = 80 -- position the virtual text at a fixed window column (starting from the first text column) , - -- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()` -} -require("nvim-dap-virtual-text").setup(opts) diff --git a/plugin-confs/nvim-docs-view.lua b/plugin-confs/nvim-docs-view.lua deleted file mode 100644 index c4cc71b..0000000 --- a/plugin-confs/nvim-docs-view.lua +++ /dev/null @@ -1,6 +0,0 @@ -require("docs-view").setup { - -- position = "right", - -- width = 90, - position = "bottom", - height = 20, -} diff --git a/plugin-confs/symbols-outline.lua b/plugin-confs/symbols-outline.lua deleted file mode 100644 index 484d266..0000000 --- a/plugin-confs/symbols-outline.lua +++ /dev/null @@ -1,53 +0,0 @@ --- init.lua -vim.g.symbols_outline = { - highlight_hovered_item = true, - show_guides = true, - auto_preview = true, - position = 'right', - relative_width = true, - width = 35, - auto_close = false, - show_numbers = false, - show_relative_numbers = false, - show_symbol_details = true, - preview_bg_highlight = 'Pmenu', - keymaps = { -- These keymaps can be a string or a table for multiple keys - close = {"", "q"}, - goto_location = "", - focus_location = "o", - hover_symbol = "", - toggle_preview = "K", - rename_symbol = "r", - code_actions = "a", - }, - lsp_blacklist = {}, - symbol_blacklist = {}, - symbols = { - File = {icon = "", hl = "TSURI"}, - Module = {icon = "", hl = "TSNamespace"}, - Namespace = {icon = "", hl = "TSNamespace"}, - Package = {icon = "", hl = "TSNamespace"}, - Class = {icon = "𝓒", hl = "TSType"}, - Method = {icon = "ƒ", hl = "TSMethod"}, - Property = {icon = "", hl = "TSMethod"}, - Field = {icon = "", hl = "TSField"}, - Constructor = {icon = "", hl = "TSConstructor"}, - Enum = {icon = "ℰ", hl = "TSType"}, - Interface = {icon = "ﰮ", hl = "TSType"}, - Function = {icon = "", hl = "TSFunction"}, - Variable = {icon = "", hl = "TSConstant"}, - Constant = {icon = "", hl = "TSConstant"}, - String = {icon = "𝓐", hl = "TSString"}, - Number = {icon = "#", hl = "TSNumber"}, - Boolean = {icon = "⊨", hl = "TSBoolean"}, - Array = {icon = "", hl = "TSConstant"}, - Object = {icon = "⦿", hl = "TSType"}, - Key = {icon = "🔐", hl = "TSType"}, - Null = {icon = "NULL", hl = "TSType"}, - EnumMember = {icon = "", hl = "TSField"}, - Struct = {icon = "𝓢", hl = "TSType"}, - Event = {icon = "🗲", hl = "TSType"}, - Operator = {icon = "+", hl = "TSOperator"}, - TypeParameter = {icon = "𝙏", hl = "TSParameter"} - } -} diff --git a/plugin-confs/trouble.lua b/plugin-confs/trouble.lua deleted file mode 100644 index ad0f1bc..0000000 --- a/plugin-confs/trouble.lua +++ /dev/null @@ -1,47 +0,0 @@ -require("trouble").setup { - position = "right", -- position of the list can be: bottom, top, left, right - height = 10, -- height of the trouble list when position is top or bottom - width = 50, -- width of the list when position is left or right - icons = true, -- use devicons for filenames - mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" - fold_open = "", -- icon used for open folds - fold_closed = "", -- icon used for closed folds - group = true, -- group results by file - padding = true, -- add an extra new line on top of the list - action_keys = { -- key mappings for actions in the trouble list - -- map to {} to remove a mapping, for example: - -- close = {}, - close = "q", -- close the list - cancel = "", -- cancel the preview and get back to your last window / buffer / cursor - refresh = "r", -- manually refresh - jump = {"", ""}, -- jump to the diagnostic or open / close folds - open_split = { "" }, -- open buffer in new split - open_vsplit = { "" }, -- open buffer in new vsplit - open_tab = { "" }, -- open buffer in new tab - jump_close = {"o"}, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location - close_folds = {"zM", "zm"}, -- close all folds - open_folds = {"zR", "zr"}, -- open all folds - toggle_fold = {"zA", "za"}, -- toggle fold of current file - previous = "k", -- preview item - next = "j" -- next item - }, - indent_lines = true, -- add an indent guide below the fold icons - auto_open = false, -- automatically open the list when you have diagnostics - auto_close = false, -- automatically close the list when you have no diagnostics - auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window - auto_fold = false, -- automatically fold a file trouble list at creation - auto_jump = {"lsp_definitions"}, -- for the given modes, automatically jump if there is only a single result - signs = { - -- icons / text used for a diagnostic - error = "", - warning = "", - hint = "", - information = "", - other = "﫠" - }, - use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client -}