repos / dotfiles

my dotfiles

commit
62a57a0
parent
0d3340a
author
Eric Bower
date
2025-07-18 22:00:05 -0400 EDT
Merge branch 'vim-pack'
2 files changed,  +59, -88
M dot_config/fish/config.fish
+1, -1
1@@ -1,6 +1,6 @@
2 fish_config theme choose "dracula"
3 
4-fish_add_path ~/.deno/bin ~/.yarn/bin ~/go/bin ~/.npm-packages/bin ~/bin /usr/local/go/bin ~/.cargo/bin
5+fish_add_path ~/.deno/bin ~/.yarn/bin ~/go/bin ~/.npm-packages/bin ~/bin /usr/local/go/bin ~/.cargo/bin ~/neovim/bin
6 
7 switch (uname)
8   case Darwin
M dot_config/nvim/init.lua
+58, -87
  1@@ -44,32 +44,24 @@ autocmd('Filetype', {
  2 })
  3 autocmd('FileType', {
  4   group = vim.api.nvim_create_augroup('close_with_q', { clear = true }),
  5-  pattern = { 'help', 'man', 'qf', 'scratch', 'fugitive' },
  6+  pattern = { 'help', 'man', 'qf', 'scratch', 'fugitive', 'nvim-pack' },
  7   callback = function(args)
  8     map('n', 'q', '<cmd>quit<cr>', { buffer = args.buf })
  9   end,
 10 })
 11 
 12-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
 13-if not (vim.uv or vim.loop).fs_stat(lazypath) then
 14-  local lazyrepo = "https://github.com/folke/lazy.nvim.git"
 15-  vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
 16-end
 17-vim.opt.rtp:prepend(lazypath)
 18-
 19 function setup_lsp()
 20   map('n', '<leader>e', vim.diagnostic.open_float, opts)
 21   map('n', '<leader>q', vim.diagnostic.setloclist, opts)
 22 
 23   local on_attach = function(client, bufnr)
 24-    -- auto-complete for any char
 25     local chars = {}
 26     for i = 32, 126 do
 27       table.insert(chars, string.char(i))
 28     end
 29+    -- auto-complete for any char
 30     client.server_capabilities.completionProvider.triggerCharacters = chars
 31-    -- built-in auto-complete
 32-    vim.lsp.completion.enable(true, client.id, bufnr, {
 33+    vim.lsp.completion.enable(true, client.id, bufnr, { -- built-in auto-complete
 34       autotrigger = true,
 35       convert = function(item)
 36         return { abbr = item.label:gsub('%b()', '') }
 37@@ -116,6 +108,36 @@ function setup_lsp()
 38   handler("zls")
 39 end
 40 
 41+function setup_fzf()
 42+  local fzf = require("fzf-lua")
 43+  fzf.setup({})
 44+  local fzf_files = function()
 45+    fzf.files({ winopts = { preview = { hidden = "hidden" } } })
 46+  end
 47+  local fzf_symbols = function()
 48+    fzf.lsp_document_symbols({ winopts = { preview = { hidden = "hidden" } } })
 49+  end
 50+  map("n", "<leader>s", fzf_files, { desc = "Fzf Files", noremap=true, silent=true })
 51+  map("n", "<leader>F", fzf_symbols, { desc = "Fzf Symbols", noremap=true, silent=true })
 52+  map("n", "<leader>f", fzf.buffers, { desc = "Fzf Buffers", noremap=true, silent=true })
 53+  map("n", "<leader>S", fzf.live_grep, { desc = "Fzf Grep", noremap=true, silent=true })
 54+  fzf.setup({"max-perf"})
 55+end
 56+
 57+vim.pack.add({
 58+  "https://github.com/nvim-lua/plenary.nvim",
 59+  "https://github.com/Mofiqul/dracula.nvim",
 60+  { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = 'main' },
 61+  "https://github.com/nvim-treesitter/nvim-treesitter-context",
 62+  "https://github.com/neovim/nvim-lspconfig",
 63+  "https://github.com/ibhagwan/fzf-lua",
 64+  "https://github.com/karb94/neoscroll.nvim",
 65+  "https://github.com/ruifm/gitlinker.nvim",
 66+  "https://github.com/tpope/vim-fugitive",
 67+})
 68+require("dracula").setup({})
 69+vim.cmd[[colorscheme dracula]]
 70+
 71 local ts_parsers = {
 72   "bash",
 73   "c",
 74@@ -146,81 +168,30 @@ local ts_parsers = {
 75   "yaml",
 76   "zig",
 77 }
 78+local nts = require("nvim-treesitter")
 79+nts.install(ts_parsers)
 80+nts.update()
 81 
 82-require("lazy").setup({
 83-  rocks = { enabled = false },
 84-  performance = {
 85-    rtp = {
 86-      disabled_plugins = {
 87-        "gzip", "matchit", "netrwPlugin",
 88-        "tarPlugin", "tohtml", "tutor", "zipPlugin",
 89-      },
 90-    },
 91-  },
 92-  spec = {
 93-    {
 94-      'Mofiqul/dracula.nvim',
 95-      lazy = false,
 96-      priority = 1000,
 97-      config = function()
 98-        vim.cmd[[colorscheme dracula]]
 99-      end
100-    },
101-    { 'neovim/nvim-lspconfig', config = setup_lsp },
102-    {
103-      'nvim-treesitter/nvim-treesitter',
104-      branch = 'main',
105-      lazy = false,
106-      -- https://github.com/nvim-treesitter/nvim-treesitter/discussions/7894#discussioncomment-13296403
107-      build = function()
108-        require("nvim-treesitter").install(ts_parsers)
109-        require("nvim-treesitter").update()
110-      end,
111-      init = function()
112-        vim.api.nvim_create_autocmd("FileType", {
113-          callback = function(args)
114-            local filetype = args.match
115-            local lang = vim.treesitter.language.get_lang(filetype)
116-            if vim.treesitter.language.add(lang) then
117-              -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
118-              vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
119-              vim.treesitter.start()
120-            end
121-          end
122-        })
123-      end,
124-      dependencies = {
125-        {
126-          "nvim-treesitter/nvim-treesitter-context",
127-          opts = {
128-            max_lines = 3,
129-            multiline_threshold = 1,
130-            separator = '-',
131-            min_window_height = 20,
132-            line_numbers = true
133-          },
134-        },
135-      },
136-    },
137-    {
138-      "ibhagwan/fzf-lua",
139-      config = function()
140-        local fzf = require('fzf-lua')
141-        local fzf_files = function()
142-          fzf.files({ winopts = { preview = { hidden = "hidden" } } })
143-        end
144-        local fzf_symbols = function()
145-          fzf.lsp_document_symbols({ winopts = { preview = { hidden = "hidden" } } })
146-        end
147-        map("n", "<leader>s", fzf_files, { desc = "Fzf Files", noremap=true, silent=true })
148-        map("n", "<leader>F", fzf_symbols, { desc = "Fzf Symbols", noremap=true, silent=true })
149-        map("n", "<leader>f", fzf.buffers, { desc = "Fzf Buffers", noremap=true, silent=true })
150-        map("n", "<leader>S", fzf.live_grep, { desc = "Fzf Grep", noremap=true, silent=true })
151-        fzf.setup({'max-perf'})
152-      end
153-    },
154-    { "karb94/neoscroll.nvim", opts = { duration_multiplier = 0.4 } },
155-    { 'ruifm/gitlinker.nvim', dependencies = 'nvim-lua/plenary.nvim', opts = {} },
156-    { "tpope/vim-fugitive" },
157-  },
158+setup_lsp()
159+setup_fzf()
160+require("treesitter-context").setup({
161+  max_lines = 3,
162+  multiline_threshold = 1,
163+  separator = '-',
164+  min_window_height = 20,
165+  line_numbers = true,
166+})
167+require("neoscroll").setup({ duration_multiplier = 0.4 })
168+require("gitlinker").setup({})
169+
170+autocmd("FileType", { -- enable treesitter highlighting and indents
171+  callback = function(args)
172+    local filetype = args.match
173+    local lang = vim.treesitter.language.get_lang(filetype)
174+    if vim.treesitter.language.add(lang) then
175+      -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
176+      vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
177+      vim.treesitter.start()
178+    end
179+  end
180 })