From 4273b7612e11d1e1de4ac66a92f49d58736c84aa Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sun, 11 Feb 2024 16:14:35 -0800 Subject: [PATCH 1/4] vim indenting and code range --- .vim/nvim.lua | 93 ++++++++++++++++++++++++++++++----------------------------- .vimrc | 12 ++++++-- 2 files changed, 56 insertions(+), 49 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 91a1ea4..394074f 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -36,22 +36,23 @@ nvim_lsp.rust_analyzer.setup({ } }) nvim_lsp.gopls.setup({ - on_attach = function (client, bufnr) - client.server_capabilities.semanticTokensProvider = { - full = true, - legend = { - --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, - tokenTypes = { 'namespace' }, - tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary', - }, - } - } - end, - settings = { - gopls = { - semanticTokens = true, - }, - }, + on_attach = function(client, bufnr) + client.server_capabilities.semanticTokensProvider = { + full = true, + legend = { + --tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', }, + tokenTypes = { 'namespace' }, + tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', + 'modification', 'documentation', 'defaultLibrary', + }, + } + } + end, + settings = { + gopls = { + semanticTokens = true, + }, + }, }) nvim_lsp.pyright.setup({ on_attach = on_attach }) @@ -67,7 +68,7 @@ nvim_lsp.hls.setup { } nvim_lsp.svelte.setup { - cmd = { "/home/barak/.yarn/bin/svelteserver", "--stdio" } + cmd = { "/home/barak/.bun/bin/bunx", "svelteserver", "--stdio" } } local runtime_path = vim.split(package.path, ';') @@ -143,31 +144,31 @@ nvim_lsp.efm.setup { -- Enable diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - signs = true, - update_in_insert = false, -} + virtual_text = false, + signs = true, + update_in_insert = false, + } ) -- Compe setup require 'compe'.setup { - enabled = true; - autocomplete = true; - debug = false; - min_length = 1; - preselect = 'disable'; - throttle_time = 80; - source_timeout = 200; - incomplete_delay = 400; - max_abbr_width = 100; - max_kind_width = 100; - max_menu_width = 100; - documentation = true; + enabled = true, + autocomplete = true, + debug = false, + min_length = 1, + preselect = 'disable', + throttle_time = 80, + source_timeout = 200, + incomplete_delay = 400, + max_abbr_width = 100, + max_kind_width = 100, + max_menu_width = 100, + documentation = true, source = { - path = true; - nvim_lsp = true; - }; + path = true, + nvim_lsp = true, + }, } --signature_cfg = { @@ -282,17 +283,17 @@ require('trouble').setup { jump = { "o", "" }, -- 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 = { "" }, -- 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 + open_tab = {}, -- open buffer in new tab + jump_close = { "" }, -- 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 + open_folds = { "zR", "zr" }, -- open all folds toggle_fold = { "zA", "za" }, -- toggle fold of current file - previous = "k", -- previous item - next = "j" -- next item + previous = "k", -- previous item + next = "j" -- next item }, } @@ -454,7 +455,7 @@ require 'nvim-treesitter.configs'.setup { playground = { enable = true, disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code persist_queries = false, -- Whether the query persists across vim sessions keybindings = { toggle_query_editor = 'o', diff --git a/.vimrc b/.vimrc index cc5bc4e..4b40af4 100644 --- a/.vimrc +++ b/.vimrc @@ -113,7 +113,6 @@ Plug 'chrisbra/NrrwRgn' "Plug 'tpope/vim-fireplace', {'for': 'clojure'} ""Plug 'terryma/vim-multiple-cursors' "Plug 'ambv/black' -Plug 'kana/vim-textobj-user' " Plugins I wish I used more @@ -126,7 +125,6 @@ Plug 'tpope/vim-unimpaired' Plug 'b4winckler/vim-angry' Plug 'tpope/vim-surround' Plug 'junegunn/vim-easy-align' -Plug 'bps/vim-textobj-python' " Plugins I NEED Plug 'scrooloose/nerdcommenter' @@ -230,6 +228,8 @@ Plug 'kristijanhusak/defx-icons' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/playground' +Plug 'nvim-treesitter/nvim-treesitter-textobjects' + "Plug 'ggandor/lightspeed.nvim' "Plug 'justinmk/vim-sneak' @@ -280,7 +280,7 @@ nnoremap gW lua vim.lsp.buf.workspace_symbol() "nnoremap gd lua vim.lsp.buf.declaration() nnoremap ga lua vim.lsp.buf.code_action() "nnoremap ga lua require('telescope.builtin').lsp_code_actions({initial_mode = "normal"}) -vnoremap ga lua vim.lsp.buf.range_code_action() +vnoremap ga lua vim.lsp.buf.code_action() "vnoremap ga :lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"}) "nnoremap ge lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) "nnoremap ge lua vim.diagnostic.open_float({focusable = false}) @@ -1083,3 +1083,9 @@ map command! -nargs=0 Syn call Syn() " Final hi links for TreeSitter hi link @type.rust TSCSecondaryTypeParam + +let s:gptool_temp = expand($HOME . '/src/gptool/bindings.vim') +if filereadable(s:gptool_temp) + exec ':so ' . s:gptool_temp +endif + From bf1dbe95e9fc78e1a053317678d9206344011a58 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 12 Feb 2024 13:44:17 -0800 Subject: [PATCH 2/4] delete the virtualfish loader (moving to rye for my own stuff) --- .config/fish/conf.d/virtualfish-loader.fish | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .config/fish/conf.d/virtualfish-loader.fish diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish deleted file mode 100644 index 88cbd8e..0000000 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ /dev/null @@ -1,4 +0,0 @@ -set -g VIRTUALFISH_VERSION 2.5.5 -set -g VIRTUALFISH_PYTHON_EXEC /bin/python -source /home/barak/.local/lib/python3.11/site-packages/virtualfish/virtual.fish -emit virtualfish_did_setup_plugins \ No newline at end of file From 1ff79d8a850fd9237d7e304d33bc8e7713997aa0 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Wed, 14 Feb 2024 15:50:28 -0800 Subject: [PATCH 3/4] add alacritty toml --- .config/alacritty/alacritty.toml | 122 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 .config/alacritty/alacritty.toml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..c228dcd --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,122 @@ +[bell] +color = "#ffffff" +duration = 200 + +[colors] +draw_bold_text_with_bright_colors = false + +[colors.bright] +black = "#565656" +blue = "#49a4f8" +cyan = "#99faf2" +green = "#c0e17d" +magenta = "#a47de9" +red = "#ec5357" +white = "#ffffff" +yellow = "#f9da6a" + +[colors.normal] +black = "#2e2e2e" +blue = "#47a0f3" +cyan = "#64dbed" +green = "#abe047" +magenta = "#7b5cb0" +red = "#eb4129" +white = "#e5e9f0" +yellow = "#f6c744" + +[colors.primary] +background = "#000000" +foreground = "#fffbf6" + +[env] +TERM = "xterm-256color" + +[font] +size = 19.0 + +[font.bold] +style = "Regular" + +[font.bold_italic] +style = "Oblique" + +[font.italic] +style = "Light Oblique" + +[font.normal] +family = "Iosevka Berkeley" +style = "Light" + +[hints] +alphabet = "jfkdls;ahgurieowpq" + +[[hints.enabled]] +action = "Copy" +regex = "[a-f0-9]{7,}" + +[hints.enabled.binding] +key = "H" +mods = "Control|Shift" + +[[hints.enabled]] +action = "Copy" +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "U" +mods = "Control|Shift" + +[[hints.enabled]] +command = "xdg-open" +post_processing = true +regex = "(magnet:|mailto:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "L" +mods = "Control|Shift" + +[hints.enabled.mouse] +enabled = true +mods = "None" + +[[keyboard.bindings]] +action = "ToggleViMode" +key = "Q" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "Paste" +key = "P" +mode = "Vi|~Search" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Alt" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "Return" +mods = "Command" + +[[keyboard.bindings]] +chars = "\u001B." +key = "Period" +mods = "Command" + +[scrolling] +history = 10000 +multiplier = 3 + +[window] +opacity = 0.88 +startup_mode = "Windowed" + +[window.dimensions] +columns = 106 +lines = 24 + +[window.padding] +x = 3 +y = 3 From ede78da06aea317a9ac7eb038b74e7d9adbb2c40 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sat, 9 Mar 2024 20:38:45 -0800 Subject: [PATCH 4/4] [vim] Add :Q as :q like :W/:w --- .vimrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index c07d3ce..33ae6e0 100644 --- a/.vimrc +++ b/.vimrc @@ -657,11 +657,15 @@ set statusline+=\ %P "percent through file " ** SMALL FUNCTIONS THAT DON'T FIT AS PLUGINS *** -" Add capital W so I can be lazy about my shift key +" Add capital W and Q so I can be lazy about my shift key if !exists(":W") command W :w endif +if !exists(":Q") + command Q :q +endif + " CD to the path of the file I'm editing. command Cdf :cd %:p:h