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