This repository was archived by the owner on Jun 28, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.lua
More file actions
137 lines (132 loc) · 4.91 KB
/
Copy pathinit.lua
File metadata and controls
137 lines (132 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.rtp:prepend(lazypath)
-- Keep sign column always visible to prevent gutter width changes
vim.opt.signcolumn = "yes"
-- Source existing vimrc
vim.cmd("source ~/.vimrc")
-- :Rgg <pattern> <path> — ripgrep with fzf in a specific directory
vim.cmd([[command! -nargs=+ -complete=dir Rgg call fzf#vim#grep("rg --column --line-number --no-heading --color=always " . <q-args>, fzf#vim#with_preview(), 0)]])
-- Load plugins
require("lazy").setup({
{ "ellisonleao/gruvbox.nvim" },
{
"sainnhe/gruvbox-material",
config = function()
vim.g.gruvbox_material_background = "hard"
end,
},
{
"ramojus/mellifluous.nvim",
config = function()
require("mellifluous").setup({})
vim.cmd("colorscheme mellifluous")
end,
},
{
"junegunn/fzf",
build = "./install --all",
},
{
"junegunn/fzf.vim",
},
{
"preservim/nerdtree",
keys = {
{ "<leader>e", ":NERDTreeToggle<cr>", desc = "Toggle NERDTree" },
{ "<leader>E", ":NERDTreeFind<cr>", desc = "Reveal current file in NERDTree" },
},
},
{
"github/copilot.vim",
cmd = "Copilot",
keys = {
{ "<leader>ce", ":Copilot enable<cr>", desc = "Enable Copilot" },
},
config = function()
-- Start Copilot only when explicitly requested via command or keymap.
vim.fn["copilot#Init"]()
end,
},
{ "airblade/vim-gitgutter" },
{ "leafOfTree/vim-svelte-plugin" },
{ "tpope/vim-surround" },
{ "tpope/vim-unimpaired" },
{ "tpope/vim-commentary" },
{ "tpope/vim-abolish" },
{ "bronson/vim-trailing-whitespace" },
{ "bronson/vim-visual-star-search" },
{ "tommcdo/vim-exchange" },
{ "zhaocai/GoldenView.Vim" },
{
"stevearc/conform.nvim",
config = function()
require("conform").setup({
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
javascriptreact = { "prettier" },
json = { "prettier" },
css = { "prettier" },
html = { "prettier" },
},
format_on_save = {
async = false,
timeout_ms = 2000,
},
})
vim.keymap.set("n", "<leader>pf", function()
require("conform").format({ async = true })
end, { desc = "Format file with prettier" })
end,
},
{
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
mappings = {
i = {
["<BS>"] = function() vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<BS>", true, false, true), "n", false) end,
["<C-k>"] = actions.move_selection_previous,
["<C-j>"] = actions.move_selection_next,
},
},
},
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
vim.lsp.config("ts_ls", {})
vim.lsp.enable("ts_ls")
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local buf = args.buf
local opts = { buffer = buf }
local builtin = require("telescope.builtin")
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<leader>ds", function()
local enc = vim.lsp.get_clients({ bufnr = buf })[1].offset_encoding
builtin.lsp_document_symbols({ fname_width = 0, pos_encoding = enc })
end, opts)
vim.keymap.set("n", "<leader>df", function()
local enc = vim.lsp.get_clients({ bufnr = buf })[1].offset_encoding
builtin.lsp_document_symbols({ fname_width = 0, pos_encoding = enc, symbols = { "Function", "Method" } })
end, opts)
end,
})
end,
},
})