diff --git a/.zshrc b/.zshrc index 6df6192..a7d2dc4 100644 --- a/.zshrc +++ b/.zshrc @@ -60,8 +60,9 @@ antigen bundle nvim antigen bundle fzf antigen bundle darvid/zsh-poetry antigen bundle Aloxaf/fzf-tab +antigen bundle vi-mode #antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv -antigen bundle jeffreytse/zsh-vi-mode +# antigen bundle jeffreytse/zsh-vi-mode antigen apply @@ -237,14 +238,6 @@ alias pn='pnpm' [ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh [ -f /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc ] && . /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc -# bindkey -M viins '^f' vi-backward-char -# bindkey -M viins '^b' vi-forward-char - -function zvm_after_init() { - [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - # [ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh - # [ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh -} #export LESS_TERMCAP_so=$'\E[30;43m' #export LDFLAGS="-L/usr/local/opt/llvm/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib" @@ -271,3 +264,9 @@ function zvm_after_init() { # unset __conda_setup # <<< conda initialize <<< +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +# [ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh +# [ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh +bindkey -M viins '^b' vi-backward-char +bindkey -M viins '^f' vi-forward-char +[ -f ~/.env ] && source ~/.env diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 1e094c3..422d1b9 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, + "avante.nvim": { "branch": "main", "commit": "d543d0ed53a870265af07a003fed893bd751f81c" }, "chowcho.nvim": { "branch": "main", "commit": "51ff2608748e9fa4ea79c1c1ae18b60c2cd24276" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -7,6 +8,7 @@ "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, "codeium.vim": { "branch": "main", "commit": "7a01ffb1e6538fe634f294908a50a7b680039284" }, "comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" }, "fidget.nvim": { "branch": "legacy", "commit": "2f7c08f45639a64a5c0abcf67321d52c3f499ae6" }, "gitsigns.nvim": { "branch": "main", "commit": "def49e48c6329527e344d0c99a0d2cd9fdf6bb84" }, "hlargs.nvim": { "branch": "main", "commit": "30fe1b3de2b7614f061be4fc9c71984a2b87e50a" }, @@ -24,6 +26,7 @@ "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "neoconf.nvim": { "branch": "main", "commit": "60f6dd6aa1006fa5c3ff4b7bf01586dcecbe9187" }, "neodev.nvim": { "branch": "main", "commit": "02893eeb9d6e8503817bd52385e111cba9a90500" }, + "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-lspconfig": { "branch": "master", "commit": "5c33bf1f708ac8cb839469e1a03d45987fec305c" }, @@ -38,6 +41,7 @@ "nvim-yati": { "branch": "main", "commit": "df3dc06076c6fe20a1dcd8643e712af5c252d042" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "render-markdown.nvim": { "branch": "main", "commit": "e919a428cee007e4fc8f86fd0ddb311a723346c7" }, "sentiment.nvim": { "branch": "main", "commit": "ecde8d877881bb78fdb90060c0991e76770dbdbc" }, "statuscol.nvim": { "branch": "main", "commit": "d6f7f5437c5404d958b88bb73e0721b1c0e09223" }, "telescope.nvim": { "branch": "master", "commit": "c392f1b78eaaf870ca584bd698e78076ed301b26" }, diff --git a/nvim/lua/legacy/gitsigns.lua b/nvim/lua/legacy/gitsigns.lua deleted file mode 100644 index e80c17b..0000000 --- a/nvim/lua/legacy/gitsigns.lua +++ /dev/null @@ -1,32 +0,0 @@ -require('gitsigns').setup({ - signs = { - add = { hl = 'GitSignsAdd', text = '┋', numhl = 'GitSignsAddNr', linehl = 'GitSignsAddLn' }, - change = { hl = 'GitSignsChange', text = '┋', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' }, - delete = { hl = 'GitSignsDelete', text = '⇉', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' }, - topdelete = { hl = 'GitSignsDelete', text = '⇊', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' }, - changedelete = { hl = 'GitSignsChange', text = '~', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' }, - }, - -- keymaps = { - -- -- Default keymap options - -- noremap = true, - -- ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'" }, - -- ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'" }, - -- }, - word_diff = false, - current_line_blame = true, - linehl = true, - numhl = true, - sign_priority = 6, - count_chars = { - [1] = '1', -- '₁', - [2] = '2', -- '₂', - [3] = '3', -- '₃', - [4] = '4', -- '₄', - [5] = '5', -- '₅', - [6] = '6', -- '₆', - [7] = '7', -- '₇', - [8] = '8', -- '₈', - [9] = '9', -- '₉', - ['+'] = '', -- '₊', - }, -}) diff --git a/nvim/lua/legacy/indent-blankline.lua b/nvim/lua/legacy/indent-blankline.lua deleted file mode 100644 index 3a65a78..0000000 --- a/nvim/lua/legacy/indent-blankline.lua +++ /dev/null @@ -1,7 +0,0 @@ -require('ibl').setup() --- setup({ --- char = '|', --- buftype_exclude = { 'terminal' }, --- show_trailing_blankline_indent = false, --- show_current_context = true, --- }) diff --git a/nvim/lua/legacy/lsp-setup.lua b/nvim/lua/legacy/lsp-setup.lua deleted file mode 100644 index 684bd19..0000000 --- a/nvim/lua/legacy/lsp-setup.lua +++ /dev/null @@ -1,101 +0,0 @@ -local utils = require('lsp-setup.utils') -local nvim_lsp = require('lspconfig') -local mappings = { - -- Example mappings for telescope pickers - gd = 'lua require"telescope.builtin".lsp_definitions({jump_type="vsplit"})', - gi = 'lua require"telescope.builtin".lsp_implementations({jump_type="vsplit"})', - gr = 'lua require"telescope.builtin".lsp_references({jump_type="vsplit"})', - go = 'lua require"telescope.builtin".lsp_document_symbols({jump_type="vsplit"})', - ['f'] = 'lua vim.lsp.buf.format({async=true})', -} - -require("neodev").setup({ - -- add any options here, or leave empty to use the default settings -}) - -local servers = { - lua_ls = {}, - bashls = {}, - helm_ls = {}, - yamlls = { - filetypes = { 'yaml', 'yml' }, - settings = { - yaml = { - schemas = { - ['https://json.schemastore.org/github-workflow.json'] = '/.github/workflows/*', - ['https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v2.0/schema.json'] = { - '/*swagger.yaml', - '/*swagger.yml', - }, - Kubernetes = { - '/*ing.yaml', - '/*deploy.yaml', - '/*sts.yaml', - '/*cm.yaml', - '/*secret.yaml', - '/*kustomization.yaml', - '/*svc.yaml', - }, - --['https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json'] = '/*.k8s.yaml', - }, - }, - }, - }, - eslint = {}, - jsonls = {}, - clangd = {}, - gopls = { - settings = { - gopls = { - gofumpt = true, - usePlaceholders = true, - staticcheck = true, - codelenses = { - gc_details = true, - }, - }, - }, - }, - tsserver = {}, - prosemd_lsp = {}, - - pylsp = {}, - rust_analyzer = { - settings = { - ['rust-analyzer'] = { - cargo = { - loadOutDirsFromCheck = true, - }, - procMacro = { - enable = true, - }, - }, - }, - }, - terraformls = {}, - -- beancount = { - -- -- filetypes = { 'beancount', 'bean' }, - -- cmd = { "beancount-language-server", "--stdio", }, - -- init_options = { - -- journalFile = "" - -- }, - -- filetypes = { "beancount", "bean" }, - -- root_dir = nvim_lsp.util.root_pattern("main.bean"), - -- single_file_support = true, - -- } -} - -local settings = { - default_mappings = true, - mappings = mappings, - servers = servers, -} - -require('lsp-setup').setup(settings) - --- require('lsp_signature').setup({}) -require('lsp-colors').setup({}) - -local border = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' } -vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) -vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }) diff --git a/nvim/lua/legacy/lsp_lines.lua b/nvim/lua/legacy/lsp_lines.lua deleted file mode 100644 index ca55bc2..0000000 --- a/nvim/lua/legacy/lsp_lines.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('lsp_lines').setup() - -vim.diagnostic.config({ - virtual_text = false, -}) diff --git a/nvim/lua/legacy/lualine.lua b/nvim/lua/legacy/lualine.lua deleted file mode 100644 index bd85a29..0000000 --- a/nvim/lua/legacy/lualine.lua +++ /dev/null @@ -1,106 +0,0 @@ -require('lualine').setup({ - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = '' }, - section_separators = { left = '', right = '' }, - disabled_filetypes = {}, - always_divide_middle = true, - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = { 'branch', 'diff', 'diagnostics' }, - lualine_c = { 'filename', 'lsp_progress' }, - lualine_x = { 'encoding', 'fileformat', 'filetype' }, - lualine_y = { 'progress' }, - lualine_z = { 'location' }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { 'filename' }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = {}, -}) - -local colors = { - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', -} - -local config = { - options = { - icons_enabled = true, - theme = 'gruvbox', - component_separators = { '', '' }, - section_separators = { '', '' }, - disabled_filetypes = {}, - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = { 'filename' }, - lualine_c = {}, - lualine_x = {}, - lualine_y = { 'encoding', 'fileformat', 'filetype' }, - lualine_z = { 'branch' }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { 'filename' }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = {}, -} - --- Inserts a component in lualine_c at left section -local function ins_left(component) - table.insert(config.sections.lualine_c, component) -end - --- Inserts a component in lualine_x ot right section -local function ins_right(component) - table.insert(config.sections.lualine_x, component) -end - ---ins_left { ---'lsp_progress', ---display_components = { 'lsp_client_name', { 'title', 'percentage', 'message' }}, ----- With spinner ----- display_components = { 'lsp_client_name', 'spinner', { 'title', 'percentage', 'message' }}, ---colors = { ---percentage = colors.cyan, ---title = colors.cyan, ---message = colors.cyan, ---spinner = colors.cyan, ---lsp_client_name = colors.magenta, ---use = true, ---}, ---separators = { ---component = ' ', ---progress = ' | ', ---message = { pre = '(', post = ')'}, ---percentage = { pre = '', post = '%% ' }, ---title = { pre = '', post = ': ' }, ---lsp_client_name = { pre = '[', post = ']' }, ---spinner = { pre = '', post = '' }, ---message = { commenced = 'In Progress', completed = 'Completed' }, ---}, ---display_components = { 'lsp_client_name', 'spinner', { 'title', 'percentage', 'message' } }, ---timer = { progress_enddelay = 500, spinner = 1000, lsp_client_name_enddelay = 1000 }, ---spinner_symbols = { '🌑 ', '🌒 ', '🌓 ', '🌔 ', '🌕 ', '🌖 ', '🌗 ', '🌘 ' }, ---} diff --git a/nvim/lua/legacy/nvim-lsputils.lua b/nvim/lua/legacy/nvim-lsputils.lua deleted file mode 100644 index 122399d..0000000 --- a/nvim/lua/legacy/nvim-lsputils.lua +++ /dev/null @@ -1,25 +0,0 @@ -local g = vim.g - -local border_chars = { - TOP_LEFT = '╭', - TOP_RIGHT = '╮', - MID_HORIZONTAL = '─', - MID_VERTICAL = '│', - BOTTOM_LEFT = '╰', - BOTTOM_RIGHT = '╯', -} - -g.lsp_utils_location_opts = { - mode = 'split', - preview = { - title = 'Location Preview', - border = true, - border_chars = border_chars, - }, - keymaps = { - n = { - [''] = 'j', - [''] = 'k', - }, - }, -} diff --git a/nvim/lua/legacy/nvim-tree.lua b/nvim/lua/legacy/nvim-tree.lua deleted file mode 100644 index 327c76c..0000000 --- a/nvim/lua/legacy/nvim-tree.lua +++ /dev/null @@ -1,104 +0,0 @@ -local function open_nvim_tree(data) - -- buffer is a real file on the disk - local real_file = vim.fn.filereadable(data.file) == 1 - - -- buffer is a [No Name] - local no_name = data.file == "" and vim.bo[data.buf].buftype == "" - - -- buffer is a directory - local directory = vim.fn.isdirectory(data.file) == 1 - - if directory then - -- create a new, empty buffer - vim.cmd.enew() - - -- wipe the directory buffer - vim.cmd.bw(data.buf) - - -- change to the directory - vim.cmd.cd(data.file) - - -- open the tree - require("nvim-tree.api").tree.open() - end - - if real_file or no_name then - -- open the tree, find the file but don't focus it - require("nvim-tree.api").tree.toggle({ focus = false, find_file = true, }) - end - -end - ---- autocmd with callbacks -vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) - -vim.api.nvim_create_autocmd("BufEnter", { - group = vim.api.nvim_create_augroup("NvimTreeClose", { clear = true }), - pattern = "NvimTree_*", - callback = function() - local layout = vim.api.nvim_call_function("winlayout", {}) - if layout[1] == "leaf" and - vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), "filetype") == "NvimTree" and - layout[3] == nil then vim.cmd("confirm quit") end - end -}) - -local function on_attach(bufnr) - local api = require('nvim-tree.api') - - local function opts(desc) - return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } - end - - api.config.mappings.default_on_attach(bufnr) - -- Mappings migrated from view.mappings.list - -- You will need to insert "your code goes here" for any mappings with a custom action_cb - vim.keymap.set('n', '', api.node.open.vertical, opts('Open: Vertical Split')) - vim.keymap.set('n', '', api.node.open.horizontal, opts('Open: Horizontal Split')) - vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split')) - vim.keymap.set('n', 's', api.node.open.horizontal, opts('Open: Horizontal Split')) - vim.keymap.set('n', 'P', function() - local node = api.tree.get_node_under_cursor() - print(node.absolute_path) - end, opts('Print Node Path')) -end - -require('nvim-tree').setup({ - view = { - width = 35, - side = 'left', - }, - -- renderer = { - -- highlight_opened_files = '1', - -- }, - diagnostics = { - enable = true, - icons = { - error = '', - warning = '', - info = '', - hint = '', - }, - }, - update_focused_file = { - enable = true, - update_root = true, - }, - filters = { - custom = { - '.git$' - }, - }, - hijack_netrw = true, - update_cwd = true, - on_attach = on_attach, -}) - --- map('n', 'te', ':NvimTreeToggle') - --- vim.cmd([[ --- autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif --- augroup nvimtree --- autocmd VimEnter * lua require('nvim-tree').toggle(false, true) --- augroup END --- ]]) diff --git a/nvim/lua/legacy/nvim_bookmarks.lua b/nvim/lua/legacy/nvim_bookmarks.lua deleted file mode 100644 index 399c7d7..0000000 --- a/nvim/lua/legacy/nvim_bookmarks.lua +++ /dev/null @@ -1,18 +0,0 @@ -local cmd = vim.cmd -local g = vim.g -local map = require('utils').map - --- vim-bookmarks -require('telescope').load_extension('vim_bookmarks') - -g['bookmark_sign'] = '⚑' -g['bookmark_highlight_lines'] = 1 -g['bookmark_no_default_key_mappings'] = 1 - -cmd([[highlight BookmarkSign ctermbg=NONE ctermfg=160]]) -cmd([[highlight BookmarkLine ctermbg=194 ctermfg=NONE]]) - -map('n', 'mm', ':BookmarkToggle') -map('n', 'mA', ':Telescope vim_bookmarks all') -map('n', 'ma', ':Telescope vim_bookmarks current_file') --- map("n", "ma", ":BookmarkShowAll") diff --git a/nvim/lua/legacy/nvim_cmp.lua b/nvim/lua/legacy/nvim_cmp.lua deleted file mode 100644 index 983d3f3..0000000 --- a/nvim/lua/legacy/nvim_cmp.lua +++ /dev/null @@ -1,45 +0,0 @@ -local fn = vim.fn - --- nvim-cmp -local cmp = require('cmp') -cmp.setup({ - snippet = { - expand = function(args) - fn['vsnip#anonymous'](args.body) - end, - }, - formatting = { - format = function(entry, vim_item) - -- set a name for each source - vim_item.menu = ({ - buffer = '[Buf]', - nvim_lsp = '[LSP]', - luasnip = '[Snip]', - nvim_lua = '[Lua]', - latex_symbols = '[Latex]', - })[entry.source.name] - return vim_item - end, - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - -- [''] = cmp.mapping.complete(), - --[""] = cmp.mapping.close(), - [''] = function(fallback) - fallback() - end, - -- [''] = cmp.mapping.confirm({ - -- behavior = cmp.ConfirmBehavior.Replace, - -- select = true, - -- }), - [''] = cmp.mapping.confirm({ select = true }), - -- [''] = cmp.mapping.select_next_item(), - -- [''] = cmp.mapping.select_prev_item(), - --}, - }), - sources = { - { name = 'nvim_lsp' }, - { name = 'buffer' }, - }, -}) diff --git a/nvim/lua/legacy/nvim_floaterm.lua b/nvim/lua/legacy/nvim_floaterm.lua deleted file mode 100644 index 74444e1..0000000 --- a/nvim/lua/legacy/nvim_floaterm.lua +++ /dev/null @@ -1,14 +0,0 @@ -local g = vim.g -local map = require('utils').map - --- floaterm -g['floaterm_keymap_new'] = '' -g['floaterm_keymap_next'] = '' -g['floaterm_keymap_prev'] = '' -g['floaterm_keymap_toggle'] = '' -g['floaterm_position'] = 'bottomright' -map('t', '', '') -map('n', 't', 'V:FloatermSend:FloatermToggle') -map('v', 't', ':FloatermSend:FloatermToggle') -map('n', 'r', 'V:FloatermSend:FloatermToggle') -map('v', 'r', ':FloatermSend:FloatermToggle') diff --git a/nvim/lua/legacy/nvim_hop.lua b/nvim/lua/legacy/nvim_hop.lua deleted file mode 100644 index dae0cc5..0000000 --- a/nvim/lua/legacy/nvim_hop.lua +++ /dev/null @@ -1,15 +0,0 @@ -local map = require('utils').map - --- hopworld -require('hop').setup({ keys = 'etovxqpdygfblzhckisuran' }) - -map('n', 'fw', 'HopWord') -map('n', 's', 'HopChar1') -map('n', 'h', 'HopWordBC') -map('n', 'j', 'HopLineStartAC') -map('n', 'k', 'HopLineStartBC') -map('n', 'l', 'HopWordAC') -map('v', 'h', 'HopWordBC') -map('v', 'j', 'HopLineStartAC') -map('v', 'k', 'HopLineStartBC') -map('v', 'l', 'HopWordAC') diff --git a/nvim/lua/legacy/nvim_telescope.lua b/nvim/lua/legacy/nvim_telescope.lua deleted file mode 100644 index 43c04ce..0000000 --- a/nvim/lua/legacy/nvim_telescope.lua +++ /dev/null @@ -1,37 +0,0 @@ -local map = require('utils').map - --- telescope -local actions = require('telescope.actions') -require('telescope').setup({ - defaults = { - layout_config = { - horizontal = { - width = 0.75, - height = 0.6, - }, - }, - mappings = { - i = { - [''] = actions.close, - [''] = actions.move_selection_previous, - [''] = actions.move_selection_next, - [''] = { '', type = 'command' }, - [''] = { '', type = 'command' }, - [''] = actions.preview_scrolling_down, - [''] = actions.preview_scrolling_up, - }, - }, - }, -}) - -local builtin = require('telescope.builtin') -map('n', 'ff', builtin.find_files) --- map('n', 'fg', [[:lua require('telescope.builtin').live_grep({additional_args = {'-j8'}})]]) -map('n', 'fb', builtin.buffers) -map('n', 'fg', function() builtin.live_grep({ additional_args = { '-j8' } }) end) -map('n', 'fh', builtin.help_tags) -map('n', ';', builtin.commands) - --- To get fzf loaded and working with telescope, you need to call --- load_extension, somewhere after setup function: -require('telescope').load_extension('fzf') diff --git a/nvim/lua/legacy/nvim_treesitter.lua b/nvim/lua/legacy/nvim_treesitter.lua deleted file mode 100644 index 122ac03..0000000 --- a/nvim/lua/legacy/nvim_treesitter.lua +++ /dev/null @@ -1,51 +0,0 @@ -local ncmd = vim.api.nvim_command - -require('nvim-treesitter.configs').setup({ - ensure_installed = { 'c', 'lua', 'rust', 'go', 'python', 'zig', 'markdown', 'solidity', 'jsonnet', 'vim', - 'javascript', 'typescript' }, - highlight = { - enable = true, - }, - playground = { - enable = true, - }, - query_linter = { - enable = true, - use_virtual_text = true, - lint_events = { 'BufWrite', 'CursorHold' }, - }, - -- nvim-treesitter/nvim-treesitter-refactor - refactor = { - highlight_definitions = { enable = true }, - smart_rename = { - enable = true, - keymaps = { - smart_rename = 'gnr', - }, - }, - }, - indent = { enable = false }, - autopairs = { enable = true }, - rainbow = { enable = true }, - autotag = { enable = true }, - context_commentstring = { enable = true }, - -- RRethy/nvim-treesitter-endwise - endwise = { - enable = true, - }, - -- andymass/vim-matchup - matchup = { - enable = true, - }, - -- nvim-treesitter/nvim-treesitter-textobjects - textobjects = { - select = { - enable = true, - lookahead = true, - }, - }, - -- yioneko/nvim-yati - yati = { enable = true }, -}) -ncmd('set foldmethod=expr') -ncmd('set foldexpr=nvim_treesitter#foldexpr()') diff --git a/nvim/lua/legacy/nvim_vimgo.lua b/nvim/lua/legacy/nvim_vimgo.lua deleted file mode 100644 index 7c8f74a..0000000 --- a/nvim/lua/legacy/nvim_vimgo.lua +++ /dev/null @@ -1,21 +0,0 @@ -local g = vim.g - --- vim-go --- let g:go_code_completion_enabled = 1 -- Enable Autocompletion ---g['go_fmt_command'] = 'goimports' -- 格式化将默认的 gofmt 替换 -g['go_autodetect_gopath'] = 1 -g['go_list_type'] = 'quickfix' -g['go_version_warning'] = 1 -g['go_highlight_types'] = 1 -g['go_highlight_fields'] = 1 -g['go_highlight_functions'] = 1 -g['go_highlight_function_calls'] = 1 -g['go_highlight_operators'] = 1 -g['go_highlight_extra_types'] = 1 -g['go_highlight_methods'] = 1 -g['go_highlight_generate_tags'] = 1 -g['godef_split'] = 2 ---g['go_fmt_command'] = 'goimports' " Run goimports along gofmt on each save -g['go_imports_mode'] = 'goimports' -g['go_imports_autosave'] = 0 -- do not auto import -g['go_auto_type_info'] = 1 -- automatically get signature/type info for object under cursor diff --git a/nvim/lua/legacy/plugin.lua b/nvim/lua/legacy/plugin.lua deleted file mode 100644 index 2f70186..0000000 --- a/nvim/lua/legacy/plugin.lua +++ /dev/null @@ -1,272 +0,0 @@ -local fn = vim.fn -local g = vim.g -local cmd = vim.cmd -local lsp = vim.lsp -local api = vim.api -local map = require('utils').map - --- Ensure packer installed -local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' -if fn.empty(fn.glob(install_path)) > 0 then - fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) - cmd('packadd packer.nvim') -end - -return require('packer').startup(function(use) - use('wbthomason/packer.nvim') - use('nvim-lua/plenary.nvim') - - use('folke/tokyonight.nvim') - use('tpope/vim-fugitive') -- git fugitive - use({ - 'lewis6991/gitsigns.nvim', - config = function() - require('config.gitsigns') - end, - }) - use({ - 'folke/which-key.nvim', - config = function() - require('which-key').setup({ - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }) - end, - }) - use({ - 'folke/trouble.nvim', - config = function() - require('config.trouble') - end, - }) - use({ - 'lukas-reineke/indent-blankline.nvim', - config = function() - require('config.indent-blankline') - end, - }) - use({ - 'MattesGroeger/vim-bookmarks', - requires = 'tom-anders/telescope-vim-bookmarks.nvim', - config = function() - require('config.nvim_bookmarks') - end, - }) - use({ - 'ojroques/vim-oscyank', - config = function() - require('config.vim-oscyank') - end, - }) - use('junegunn/vim-easy-align') -- 可以快速对齐的插件 - use({ - 't9md/vim-choosewin', - }) - use({ - 'akinsho/toggleterm.nvim', - config = function() - require('config.toggleterm') - end, - }) - use('wakatime/vim-wakatime') - use({ - 'numToStr/Comment.nvim', - config = function() - require('Comment').setup() - end, - }) - use({ - 'windwp/nvim-autopairs', - config = function() - -- nvim-autopairs - require('nvim-autopairs').setup({}) - end, - }) - use({ - 'kyazdani42/nvim-tree.lua', - requires = 'kyazdani42/nvim-web-devicons', - config = function() - require('config.nvim-tree') - end, - }) - use({ - 'nvim-telescope/telescope.nvim', - config = function() - require('config.nvim_telescope') - end, - requires = { - { - 'nvim-telescope/telescope-fzf-native.nvim', - run = 'make', - config = function() - require('telescope').load_extension('fzf') - end - } - }, - }) - use({ - 'hrsh7th/nvim-cmp', - config = function() - require('config.nvim_cmp') - end, - requires = { - 'hrsh7th/cmp-vsnip', - 'hrsh7th/vim-vsnip', - 'hrsh7th/vim-vsnip-integ', - }, - }) - use('hrsh7th/cmp-buffer') - use({ - 'folke/lsp-colors.nvim', - config = function() - require('lsp-colors').setup({}) - end, - }) - use({ - 'RishabhRD/nvim-lsputils', - config = function() - require('config.nvim-lsputils') - end, - }) - use({ - 'https://git.sr.ht/~whynothugo/lsp_lines.nvim', - config = function() - require('config.lsp_lines') - end, - }) - use({ - 'github/copilot.vim', - setup = function() - vim.g.copilot_no_tab_map = 1 - vim.g.copilot_no_maps = 1 - vim.g.copilot_assume_mapped = 1 - end, - config = function() - local map = require('utils').map - map('i', '', 'copilot#Accept()', { expr = true }) - end, - }) - use({ - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate', - config = function() - require('config.nvim_treesitter') - end, - requires = { - 'nvim-treesitter/playground', - 'nvim-treesitter/nvim-treesitter-refactor', - 'nvim-treesitter/nvim-treesitter-textobjects', - 'nvim-treesitter/nvim-treesitter-context', - 'RRethy/nvim-treesitter-endwise', - 'andymass/vim-matchup', -- extend % key - 'yioneko/nvim-yati', - 'm-demare/hlargs.nvim', - }, - }) - use({ - "iamcco/markdown-preview.nvim", - run = function() vim.fn["mkdp#util#install"]() end, - }) - - use({ - "iamcco/markdown-preview.nvim", - run = "cd app && npm install", - setup = function() vim.g.mkdp_filetypes = { "markdown" } end, - ft = { "markdown" }, - }) - use({ - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true }, - config = function() - require('config.lualine') - end, - }) - use({ - 'j-hui/fidget.nvim', - config = function() - require('fidget').setup({}) - end, - }) - -- use 'arkav/lualine-lsp-progress' - use({ - 'romgrk/barbar.nvim', - requires = { 'kyazdani42/nvim-web-devicons' }, - }) - use({ - 'folke/todo-comments.nvim', - config = function() - require('todo-comments').setup({}) - end, - }) - use({ - 'phaazon/hop.nvim', - as = 'hop', - config = function() - -- you can configure Hop the way you like here; see :h hop-config - require('config.nvim_hop') - end, - }) - use({ - 'preservim/tagbar', - config = function() - require('config.tagbar') - end, - }) - - -- BETTER editor - use({ - 'vinnymeller/swagger-preview.nvim', - run = "npm install -g swagger-ui-watcher", - config = function() - require("swagger-preview").setup({ - -- The port to run the preview server on - port = 9000, - -- The host to run the preview server on - host = "localhost", - }) - end, - }) - - -- LANGUAGES - use({ - 'Junnplus/lsp-setup.nvim', - config = function() - require('config.lsp-setup') - end, - requires = { - 'neovim/nvim-lspconfig', - 'hrsh7th/cmp-nvim-lsp', - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'folke/lsp-colors.nvim', - 'folke/neodev.nvim', - 'ray-x/lsp_signature.nvim', - - 'RRethy/vim-illuminate', - 'simrat39/rust-tools.nvim', - 'p00f/clangd_extensions.nvim', - }, - }) - -- k8s - -- use('andrewstuart/vim-kubernetes') - - -- go - use({ - 'fatih/vim-go', - run = ':GoUpdateBinaries', - config = function() - require('config.nvim_vimgo') - end, - }) - -- erlang - use('vim-erlang/vim-erlang-tags') - use('iamcco/mathjax-support-for-mkdp') - --beancount - -- use('nathangrigg/vim-beancount') - -- python - use('Vimjas/vim-python-pep8-indent') - -- rust - use('rust-lang/rust.vim') - use('mfussenegger/nvim-dap') -end) diff --git a/nvim/lua/legacy/tagbar.lua b/nvim/lua/legacy/tagbar.lua deleted file mode 100644 index e69de29..0000000 diff --git a/nvim/lua/legacy/toggleterm.lua b/nvim/lua/legacy/toggleterm.lua deleted file mode 100644 index 3f75131..0000000 --- a/nvim/lua/legacy/toggleterm.lua +++ /dev/null @@ -1,15 +0,0 @@ -local g = vim.g -local map = require('utils').map - -map('t', '', [[]], { noremap = true }) - -require('toggleterm').setup({ - open_mapping = [[]], - size = function(term) - if term.direction == 'horizontal' then - return 15 - else - return vim.o.columns * 0.3 - end - end, -}) diff --git a/nvim/lua/legacy/trouble.lua b/nvim/lua/legacy/trouble.lua deleted file mode 100644 index e43f2ae..0000000 --- a/nvim/lua/legacy/trouble.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('trouble').setup({ - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below -}) diff --git a/nvim/lua/legacy/vim-oscyank.lua b/nvim/lua/legacy/vim-oscyank.lua deleted file mode 100644 index ae5eadb..0000000 --- a/nvim/lua/legacy/vim-oscyank.lua +++ /dev/null @@ -1,4 +0,0 @@ -local map = require('utils').map - -map('v', 'yy', ':OSCYank') -map('n', 'o', 'OSCYank') diff --git a/nvim/lua/legacy/vista.lua b/nvim/lua/legacy/vista.lua deleted file mode 100644 index 82b8030..0000000 --- a/nvim/lua/legacy/vista.lua +++ /dev/null @@ -1,15 +0,0 @@ -local api = vim.api - -api.nvim_exec( - [[ -" Ensure you have installed some decent font to show these pretty symbols, then you can enable icon for the kind. -let g:vista#renderer#enable_icon = 1 - -" The default icons can't be suitable for all the filetypes, you can extend it as you wish. -let g:vista#renderer#icons = { -\ "function": "\uf794", -\ "variable": "\uf71b", -\ } -]], - false -) diff --git a/nvim/lua/plugins/avante.lua b/nvim/lua/plugins/avante.lua new file mode 100644 index 0000000..e7f2c02 --- /dev/null +++ b/nvim/lua/plugins/avante.lua @@ -0,0 +1,23 @@ +return { + "yetone/avante.nvim", + event = "VeryLazy", + -- build = "make", -- This is Optional, only if you want to use tiktoken_core to calculate tokens count + opts = { + -- provider = "claude", + provider = "openai", + }, + dependencies = { + "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + "stevearc/dressing.nvim", + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + --- The below is optional, make sure to setup it properly if you have lazy=true + { + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, +} diff --git a/nvim/lua/plugins/lsp-setup.lua b/nvim/lua/plugins/lsp-setup.lua index 4a121b4..89851d8 100644 --- a/nvim/lua/plugins/lsp-setup.lua +++ b/nvim/lua/plugins/lsp-setup.lua @@ -64,6 +64,8 @@ return { } } }, + crystalline = {}, + terraformls = {}, jsonls = {}, bashls = {}, tsserver = { diff --git a/nvim/lua/plugins/tree.lua b/nvim/lua/plugins/tree.lua index 4082f36..62d8b5e 100644 --- a/nvim/lua/plugins/tree.lua +++ b/nvim/lua/plugins/tree.lua @@ -20,6 +20,7 @@ return { vim.api.nvim_create_autocmd('BufEnter', { callback = close_nvim_tree }) end, opts = { + filters = { dotfiles = false, custom = { '^.git$' } }, on_attach = function(bufnr) local function map(mode, l, r, opts) opts = opts or {}