relocate config files
This commit is contained in:
parent
5e530b9dbc
commit
df34683aea
45 changed files with 0 additions and 0 deletions
0
nvim/.gitignore
vendored
Normal file
0
nvim/.gitignore
vendored
Normal file
35
nvim/init.lua
Normal file
35
nvim/init.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
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",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local has = vim.fn.has
|
||||
local is_mac = has "macunix"
|
||||
local is_wsl = has "wsl"
|
||||
local is_unix = has "unix"
|
||||
|
||||
-- custom modules:
|
||||
require("keymaps")
|
||||
require("options")
|
||||
|
||||
if is_wsl == 1 then
|
||||
require("clipboard-wsl")
|
||||
end
|
||||
|
||||
if is_mac == 1 then
|
||||
require("clipboard-macos")
|
||||
end
|
||||
|
||||
if is_unix == 1 and is_mac ~= 1 then
|
||||
require("clipboard-unix")
|
||||
end
|
||||
|
||||
require("lazy").setup("plugins")
|
||||
39
nvim/lazy-lock.json
Normal file
39
nvim/lazy-lock.json
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "57c9f5c31b3d712376c704673eac8e948c82e9c1" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"fzf": { "branch": "master", "commit": "d21d5c9510170d74a7f959309da720b6df72ca01" },
|
||||
"fzf-lua": { "branch": "main", "commit": "a1a2d0f42eaec400cc6918a8e898fc1f9c4dbc5f" },
|
||||
"git.nvim": { "branch": "main", "commit": "741696687486f25f8b73d9e4c76ab2ede9998f39" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" },
|
||||
"harpoon": { "branch": "master", "commit": "867e212ac153e793f95b316d1731f3ca1894625e" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d4c718467d35bc93714425a7102d82e7e5065280" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||
"lsp-zero.nvim": { "branch": "v2.x", "commit": "ffebf6f7b0649f1eb81b37c37b75552f8ff96337" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" },
|
||||
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
||||
"nvim-dap": { "branch": "master", "commit": "d7749eb3d9933a75d2244820308ce442f646c7ae" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "eb81c7ea08d6f01d5fa4cf09e58c708efadf9b2f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "25ddfde8d7167d7d81403d6809242439037d2b68" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "a1425903ab52a0a0460622519e827f224e5b4fee" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
|
||||
"rose-pine": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" },
|
||||
"telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "98101b22402cd6d1c7e9a7e0c4718bfc98cb1625" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
|
||||
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
|
||||
"vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" },
|
||||
"vim-floaterm": { "branch": "master", "commit": "3f01a623376957437f9376327637491b74719e38" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
||||
1
nvim/lua/clipboard-macos.lua
Normal file
1
nvim/lua/clipboard-macos.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.opt.clipboard:append { "unnamedplus" }
|
||||
14
nvim/lua/clipboard-unix.lua
Normal file
14
nvim/lua/clipboard-unix.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
-- vim.opt.clipboard:append { "unnamedplus" }
|
||||
|
||||
vim.g.clipboard = {
|
||||
name = "xclip",
|
||||
copy = {
|
||||
['+'] = "xclip -sel clip -i -quiet",
|
||||
['*'] = "xclip -sel primary -i -quiet",
|
||||
},
|
||||
paste = {
|
||||
['+'] = "xclip -sel clip -o -quiet",
|
||||
['*'] = "xclip -sel primary -o -quiet",
|
||||
},
|
||||
cache_enabled = 1,
|
||||
}
|
||||
12
nvim/lua/clipboard-wsl.lua
Normal file
12
nvim/lua/clipboard-wsl.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
vim.g.clipboard = {
|
||||
name = "win32yank",
|
||||
copy = {
|
||||
['+'] = "win32yank.exe -i --crlf",
|
||||
['*'] = "win32yank.exe -i --crlf",
|
||||
},
|
||||
paste = {
|
||||
['+'] = "win32yank.exe -o --lf",
|
||||
['*'] = "win32yank.exe -o --lf",
|
||||
},
|
||||
cache_enabled = 0,
|
||||
}
|
||||
101
nvim/lua/keymaps.lua
Normal file
101
nvim/lua/keymaps.lua
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- easy escape
|
||||
vim.keymap.set("i", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("v", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
|
||||
-- easy escape
|
||||
vim.keymap.set("i", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("v", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<C-[>", "<Esc>", { noremap = true, silent = true })
|
||||
|
||||
-- open the explorer
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>Ex<CR>")
|
||||
|
||||
-- move highlighted lines
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- make cursor stay in same position when appending line below
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
|
||||
-- make cursor stay in the middle while moving down/up the page
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
||||
-- make cursor stay in the middle while looking through search results
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
-- do not copy with x, for god sake, WHY copy something that is being deleted??
|
||||
vim.keymap.set("n", "x", "\"_x")
|
||||
|
||||
-- smile :)
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
vim.keymap.set("n", "q", "<nop>", { noremap = true })
|
||||
-- keymap below needs a better combo, need this to enable macros
|
||||
-- vim.keymap.set("n", "<leader>q", "q", { noremap = true })
|
||||
|
||||
-- select and replace
|
||||
vim.keymap.set("n", "<leader>ss", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
-- no copy, delete line, for god sake...
|
||||
vim.keymap.set("n", "dd", "\"_dd")
|
||||
vim.keymap.set("n", "<leader>dd", "dd") -- cut line, under my control
|
||||
vim.keymap.set("x", "d", "\"_d")
|
||||
|
||||
-- copy/paste to/from system clipboard
|
||||
vim.keymap.set({ "n", "v" }, "<leader>y", "\"+y")
|
||||
vim.keymap.set({ "n", "v" }, "<leader>p", "\"+p")
|
||||
-- yank/put to/from register 'a'
|
||||
vim.keymap.set("x", "ay", '"ay', { noremap = true })
|
||||
vim.keymap.set("x", "ap", '"ap', { noremap = true })
|
||||
|
||||
-- increment/decrement a count, helpful for changing indeces
|
||||
vim.keymap.set("n", "+", "<C-a>")
|
||||
vim.keymap.set("n", "-", "<C-x>")
|
||||
|
||||
-- do not copy when deleting word
|
||||
vim.keymap.set("n", "dw", "\"_dw")
|
||||
vim.keymap.set("n", "de", "\"_de")
|
||||
vim.keymap.set("n", "<leader>dw", "dw")
|
||||
vim.keymap.set("n", "<leader>de", "de")
|
||||
vim.keymap.set("n", "db", "vb\"_d") -- delete in backwards
|
||||
vim.keymap.set("n", "<leader>db", "vbd")
|
||||
|
||||
vim.keymap.set("n", "<C-a>", "gg<S-v>G") -- select all
|
||||
|
||||
-- split pane
|
||||
vim.keymap.set("n", "ss", ":split<Return><C-w>w", { silent = true }) -- horizontal
|
||||
vim.keymap.set("n", "sv", ":vsplit<Return><C-w>w", { silent = true }) -- vertical
|
||||
|
||||
-- pane movement
|
||||
vim.keymap.set("n", "..", "<C-w>w") -- toggle
|
||||
vim.keymap.set("n", "sh", "<C-w>h")
|
||||
vim.keymap.set("n", "sk", "<C-w>k")
|
||||
vim.keymap.set("n", "sl", "<C-w>l")
|
||||
vim.keymap.set("n", "sj", "<C-w>j")
|
||||
|
||||
-- resize pane
|
||||
vim.keymap.set("n", "<C-w><left>", "<C-w><")
|
||||
vim.keymap.set("n", "<C-w><right>", "<C-w>>")
|
||||
vim.keymap.set("n", "<C-w><up>", "<C-w>+")
|
||||
vim.keymap.set("n", "<C-w><down>", "<C-w>-")
|
||||
|
||||
-- my arrow keys babyyyy
|
||||
vim.keymap.set("i", "<C-h>", "<Left>", { noremap = true })
|
||||
vim.keymap.set("i", "<C-j>", "<Down>", { noremap = true })
|
||||
vim.keymap.set("i", "<C-k>", "<Up>", { noremap = true })
|
||||
vim.keymap.set("i", "<C-l>", "<Right>", { noremap = true })
|
||||
|
||||
-- terminal keymaps
|
||||
vim.keymap.set("t", "<C-t>", "<C-\\><C-n>", { noremap = true }) -- exit insert mode in terminal
|
||||
vim.keymap.set("t", "<C-x>", "<cmd>bd!<CR>", { noremap = true }) -- terminate terminal session
|
||||
vim.keymap.set("n", "<C-t>", "<cmd>term<CR>i", { noremap = true }) -- create new terminal session
|
||||
|
||||
vim.keymap.set({ 'n', 'v' }, "<Space>", "<Nop>", { silent = true })
|
||||
|
||||
-- lazygit on floaterm
|
||||
vim.keymap.set("n", "<leader>g", "<cmd>FloatermNew lazygit<CR>", { noremap = true })
|
||||
62
nvim/lua/options.lua
Normal file
62
nvim/lua/options.lua
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
vim.scriptencoding = "utf-8"
|
||||
vim.opt.encoding = "utf-8"
|
||||
vim.opt.fileencoding = "utf-8"
|
||||
|
||||
vim.wo.number = true -- show line number
|
||||
vim.opt.relativenumber = true -- juicy relativity
|
||||
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.smarttab = true
|
||||
vim.opt.breakindent = true
|
||||
|
||||
vim.opt.wrap = false -- bad, stay away from me!
|
||||
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true -- highlight search pattern as you type
|
||||
|
||||
vim.opt.scrolloff = 8 -- give me some personal space
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
|
||||
vim.opt.ignorecase = true -- case-insensitive search
|
||||
|
||||
vim.opt.backspace = { "start", "eol", "indent" }
|
||||
|
||||
-- don't want to look into these...
|
||||
vim.opt.wildignore:append { "*/node_modules/*", "*/__pycache__/*" }
|
||||
|
||||
-- add '*' in block comments
|
||||
vim.opt.formatoptions:append { 'r' }
|
||||
|
||||
-- theme
|
||||
vim.opt.winblend = 0
|
||||
vim.opt.wildoptions = "pum" -- show popup for autocomplete
|
||||
vim.opt.pumblend = 5
|
||||
vim.opt.background = "dark"
|
||||
vim.opt.termguicolors = true -- good shit, just take it
|
||||
|
||||
-- activate persistent undo
|
||||
vim.opt.undofile = true
|
||||
|
||||
|
||||
-- [[ highlight on yank ]]
|
||||
local highligh_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highligh_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
||||
|
||||
vim.opt.completeopt = 'menuone,noselect'
|
||||
|
||||
vim.opt.breakindent = true
|
||||
|
||||
vim.opt.cursorline = true
|
||||
7
nvim/lua/plugins/autopairs.lua
Normal file
7
nvim/lua/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
disable_filetype = { "TelescopePrompt", "vim" }
|
||||
},
|
||||
}
|
||||
15
nvim/lua/plugins/autotag.lua
Normal file
15
nvim/lua/plugins/autotag.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' },
|
||||
ft = {
|
||||
'javascriptreact',
|
||||
'typescriptreact',
|
||||
},
|
||||
config = function()
|
||||
local autotag = require('nvim-ts-autotag')
|
||||
autotag.setup({
|
||||
enable = true,
|
||||
enable_close_on_slash = false,
|
||||
})
|
||||
end
|
||||
}
|
||||
3
nvim/lua/plugins/closetag.lua
Normal file
3
nvim/lua/plugins/closetag.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"alvan/vim-closetag"
|
||||
}
|
||||
20
nvim/lua/plugins/colorscheme.lua
Normal file
20
nvim/lua/plugins/colorscheme.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
{
|
||||
"rose-pine/nvim",
|
||||
name = "rose-pine",
|
||||
priority = 1000,
|
||||
enabled = true,
|
||||
config = function()
|
||||
vim.cmd.colorscheme("rose-pine")
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Theme inspired by Atom
|
||||
'navarasu/onedark.nvim',
|
||||
priority = 1000,
|
||||
enabled = false,
|
||||
config = function()
|
||||
vim.cmd.colorscheme 'onedark'
|
||||
end,
|
||||
},
|
||||
}
|
||||
34
nvim/lua/plugins/comment.lua
Normal file
34
nvim/lua/plugins/comment.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
dependencies = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
config = function()
|
||||
local comment = require('Comment')
|
||||
comment.setup({
|
||||
pre_hook = function(ctx)
|
||||
-- only for tsx/jsx filetypes
|
||||
if vim.bo.filetype == "typescriptreact" or vim.bo.filetype == "javascriptreact" then
|
||||
local U = require('Comment.utils')
|
||||
|
||||
-- determine wheter to use linwise or blockwise commentstring
|
||||
local type = ctx.ctype == U.ctype.linewise and '__default' or '__multiline'
|
||||
|
||||
|
||||
-- determine the location where to calcualte commentstring from
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.blockwise then
|
||||
location = require('ts_context_commentstring.utils').get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require('ts_context_commentstring.utils').get_visual_start_location()
|
||||
end
|
||||
|
||||
return require('ts_context_commentstring.internal').calculate_commentstring({
|
||||
key = type,
|
||||
location = location,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
6
nvim/lua/plugins/floaterm.lua
Normal file
6
nvim/lua/plugins/floaterm.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"voldikss/vim-floaterm",
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>FloatermNew lazygit<CR>", desc = "Open lazygit in a floating window" },
|
||||
},
|
||||
}
|
||||
10
nvim/lua/plugins/fzf.lua
Normal file
10
nvim/lua/plugins/fzf.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"ibhagwan/fzf-lua",
|
||||
-- optional for icon support
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
{ "junegunn/fzf", build = "./install --bin" }
|
||||
},
|
||||
opts = {},
|
||||
enabled = true,
|
||||
}
|
||||
25
nvim/lua/plugins/git.lua
Normal file
25
nvim/lua/plugins/git.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
'dinhhuy258/git.nvim',
|
||||
keys = {
|
||||
{ "<leader>gbl", "<cmd>GitBlame<CR>", desc = "Open [G]it [Bl]ame" },
|
||||
{ "<leader>gd", "<cmd>GitDiff<CR>", desc = "Open [G]it [D]iff" },
|
||||
},
|
||||
cmd = {
|
||||
"Git",
|
||||
"GitBlame",
|
||||
"GitDiff",
|
||||
},
|
||||
config = function()
|
||||
local git = require('git')
|
||||
|
||||
git.setup({
|
||||
default_keymaps = true,
|
||||
keymaps = {
|
||||
quit_blame = "q",
|
||||
diff_close = "q",
|
||||
},
|
||||
target_branch = "main",
|
||||
|
||||
})
|
||||
end
|
||||
}
|
||||
12
nvim/lua/plugins/gitsigns.lua
Normal file
12
nvim/lua/plugins/gitsigns.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol',
|
||||
delay = 1000,
|
||||
ignore_whitespace = false
|
||||
},
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/harpoon.lua
Normal file
18
nvim/lua/plugins/harpoon.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<leader>q", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<leader>w", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<leader>e", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<leader>r", function() ui.nav_file(4) end)
|
||||
vim.keymap.set("n", "<leader>,", ui.nav_prev)
|
||||
vim.keymap.set("n", "<leader>.", ui.nav_next)
|
||||
end
|
||||
}
|
||||
12
nvim/lua/plugins/indent-blankline.lua
Normal file
12
nvim/lua/plugins/indent-blankline.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {
|
||||
indent = {
|
||||
smart_indent_cap = true,
|
||||
},
|
||||
scope = {
|
||||
show_end = true,
|
||||
},
|
||||
},
|
||||
main = "ibl"
|
||||
}
|
||||
132
nvim/lua/plugins/lsp-zero.lua
Normal file
132
nvim/lua/plugins/lsp-zero.lua
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
return {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v2.x',
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{ 'neovim/nvim-lspconfig' }, -- Required
|
||||
{
|
||||
-- Optional
|
||||
'williamboman/mason.nvim',
|
||||
build = function()
|
||||
pcall(vim.cmd, 'MasonUpdate')
|
||||
end,
|
||||
},
|
||||
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{ 'hrsh7th/nvim-cmp' }, -- Required
|
||||
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
|
||||
{ 'L3MON4D3/LuaSnip' }, -- Required
|
||||
},
|
||||
config = function()
|
||||
local lspzero = require("lsp-zero")
|
||||
|
||||
lspzero.preset({})
|
||||
|
||||
lspzero.on_attach(function(client, bufnr)
|
||||
lspzero.default_keymaps({
|
||||
buffer = bufnr,
|
||||
omit = {
|
||||
'gr'
|
||||
},
|
||||
})
|
||||
|
||||
function nmap(key, action, desc)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
key,
|
||||
action,
|
||||
{
|
||||
desc = "LSP: " .. desc,
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
nmap("[d", "<cmd>lua vim.diagnostic.goto_prev()<CR>", "Goto Prev Diagnostic");
|
||||
nmap("]d", "<cmd>lua vim.diagnostic.goto_next()<CR>", "Goto Next Diagnostic")
|
||||
|
||||
local current_dir = vim.fn.expand("%:p:h")
|
||||
|
||||
-- vim.keymap.set('n', 'gr', '<cmd>Telescope lsp_references<cr>', { buffer = true })
|
||||
|
||||
-- format with space + f
|
||||
-- vim.keymap.set("n", "<leader>fb", "<cmd>lua vim.lsp.buf.format()<CR>",
|
||||
-- { desc = "[F]ormat [B]uffer" })
|
||||
nmap("<leader>fb", "<cmd>lua vim.lsp.buf.format()<CR>", "[F]ormat [B]uffer")
|
||||
end)
|
||||
|
||||
lspzero.ensure_installed({
|
||||
"tsserver",
|
||||
"eslint",
|
||||
"tailwindcss",
|
||||
})
|
||||
|
||||
lspzero.format_on_save({
|
||||
format_ops = {
|
||||
async = true,
|
||||
timeout_ms = 10000,
|
||||
},
|
||||
servers = {
|
||||
["lua_ls"] = { "lua" },
|
||||
["null-ls"] = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"html",
|
||||
"css",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local status, lspconfig = pcall(require, "lspconfig")
|
||||
|
||||
if status then
|
||||
lspconfig.tsserver.setup({})
|
||||
lspconfig.tailwindcss.setup({
|
||||
filetypes = {
|
||||
'templ',
|
||||
'html',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'javascriptreact',
|
||||
'typescriptreact',
|
||||
},
|
||||
init_options = {
|
||||
userLanguages = {
|
||||
templ = "html"
|
||||
}
|
||||
}
|
||||
})
|
||||
lspconfig.zls.setup({})
|
||||
lspconfig.rust_analyzer.setup({})
|
||||
lspconfig.gopls.setup({})
|
||||
lspconfig.html.setup({})
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
templ = "templ"
|
||||
},
|
||||
})
|
||||
lspconfig.templ.setup({
|
||||
filetypes = {
|
||||
"templ",
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
lspzero.setup()
|
||||
|
||||
local cmp
|
||||
status, cmp = pcall(require, "cmp")
|
||||
|
||||
if not status then return end
|
||||
|
||||
cmp.setup({
|
||||
mapping = {
|
||||
-- press 'enter' to confirm completion/suggestion
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
58
nvim/lua/plugins/lualine.lua
Normal file
58
nvim/lua/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
config = function()
|
||||
local lualine = require('lualine')
|
||||
|
||||
lualine.setup {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
--[[ section_separators = {
|
||||
left = '',
|
||||
right = ''
|
||||
},
|
||||
component_separators = {
|
||||
left = '',
|
||||
right = ''
|
||||
}, ]]
|
||||
section_separators = '',
|
||||
component_separators = '|',
|
||||
disabled_filetypes = {}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch' },
|
||||
lualine_c = { {
|
||||
'filename',
|
||||
file_status = true, -- display file status
|
||||
path = 0 -- no file path
|
||||
} },
|
||||
lualine_x = {
|
||||
{
|
||||
'diagnostics',
|
||||
sources = { 'nvim_diagnostic' },
|
||||
symbols = { error = ' ', warn = ' ', info = ' ', hint = '' }
|
||||
},
|
||||
'enconding',
|
||||
'filetype'
|
||||
},
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { {
|
||||
'filename',
|
||||
file_status = true,
|
||||
path = 1
|
||||
} },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { 'fugitive' }
|
||||
}
|
||||
end
|
||||
}
|
||||
10
nvim/lua/plugins/markdown-preview.lua
Normal file
10
nvim/lua/plugins/markdown-preview.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
ft = "markdown",
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>mp", "<cmd>MarkdownPreviewToggle<CR>", desc = "Toggle [M]arkdown [P]review" }
|
||||
}
|
||||
}
|
||||
71
nvim/lua/plugins/neo-tree.lua
Normal file
71
nvim/lua/plugins/neo-tree.lua
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
enabled = false,
|
||||
branch = "v2.x",
|
||||
cmd = { "Neotree" },
|
||||
keys = {
|
||||
{ "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" },
|
||||
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" }
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
use_default_mappings = true,
|
||||
mappings = {
|
||||
["<space>"] = {
|
||||
"toggle_node",
|
||||
nowait = true, -- disable `nowait` if you have existing combos starting with this char that you want to use
|
||||
},
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
["<esc>"] = "cancel", -- close preview or floating neo-tree window
|
||||
["P"] = { "toggle_preview", config = { use_float = true } },
|
||||
["l"] = "focus_preview",
|
||||
["O"] = "open_split",
|
||||
["o"] = "open_vsplit",
|
||||
["S"] = "none",
|
||||
["s"] = "none",
|
||||
-- ["S"] = "split_with_window_picker",
|
||||
-- ["s"] = "vsplit_with_window_picker",
|
||||
["t"] = "open_tabnew",
|
||||
-- ["<cr>"] = "open_drop",
|
||||
-- ["t"] = "open_tab_drop",
|
||||
["w"] = "open_with_window_picker",
|
||||
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
|
||||
["C"] = "close_node",
|
||||
-- ['C'] = 'close_all_subnodes',
|
||||
["z"] = "close_all_nodes",
|
||||
--["Z"] = "expand_all_nodes",
|
||||
["a"] = {
|
||||
"add",
|
||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
|
||||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
show_path = "none" -- "none", "relative", "absolute"
|
||||
}
|
||||
},
|
||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
||||
["d"] = "delete",
|
||||
["r"] = "rename",
|
||||
["y"] = "copy_to_clipboard",
|
||||
["x"] = "cut_to_clipboard",
|
||||
["p"] = "paste_from_clipboard",
|
||||
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
||||
-- ["c"] = {
|
||||
-- "copy",
|
||||
-- config = {
|
||||
-- show_path = "none" -- "none", "relative", "absolute"
|
||||
-- }
|
||||
--}
|
||||
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
||||
["q"] = "close_window",
|
||||
["R"] = "refresh",
|
||||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
}
|
||||
}
|
||||
}
|
||||
10
nvim/lua/plugins/neodev.lua
Normal file
10
nvim/lua/plugins/neodev.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"folke/neodev.nvim",
|
||||
enabled = false,
|
||||
opts = {
|
||||
library = {
|
||||
plugins = true,
|
||||
types = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
15
nvim/lua/plugins/null-ls.lua
Normal file
15
nvim/lua/plugins/null-ls.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.prettierd,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
21
nvim/lua/plugins/nvim-dap-ui.lua
Normal file
21
nvim/lua/plugins/nvim-dap-ui.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
'mfussenegger/nvim-dap',
|
||||
},
|
||||
config = function()
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
dapui.setup({
|
||||
width = 50,
|
||||
})
|
||||
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated['dapui_config'] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited['dapui_config'] = function()
|
||||
dapui.close()
|
||||
end
|
||||
end
|
||||
}
|
||||
65
nvim/lua/plugins/nvim-dap-vscode-js.lua
Normal file
65
nvim/lua/plugins/nvim-dap-vscode-js.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
local DEBUGGER_PATH = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"
|
||||
|
||||
return {
|
||||
{
|
||||
"microsoft/vscode-js-debug",
|
||||
lazy = true,
|
||||
build = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out",
|
||||
enabled = false,
|
||||
},
|
||||
{
|
||||
'mxsdev/nvim-dap-vscode-js',
|
||||
enabled = false,
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
config = function()
|
||||
local dapVsCode = require("dap-vscode-js")
|
||||
dapVsCode.setup({
|
||||
node_path = "node",
|
||||
debugger_path = DEBUGGER_PATH,
|
||||
adapters = {
|
||||
"pwa-node",
|
||||
"pwa-chrome",
|
||||
"pwa-msedge",
|
||||
"pwa-extensionHost",
|
||||
"node-terminal",
|
||||
}
|
||||
})
|
||||
|
||||
for _, language in ipairs({ "typescript", "javascript" }) do
|
||||
require("dap").configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file (node)",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach (node)",
|
||||
processId = require('dap.utils').pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Debug Jest Tests",
|
||||
trace = true,
|
||||
runtimeExecutable = "node",
|
||||
runtimeArgs = {
|
||||
"./node_modules/jest/bin/jest.js",
|
||||
"--runInBand",
|
||||
},
|
||||
rootPath = "${workspaceFolder}",
|
||||
cwd = "${workspaceFolder}",
|
||||
console = "integratedTerminal",
|
||||
internalConsoleOptions = "neverOpen",
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
78
nvim/lua/plugins/nvim-dap.lua
Normal file
78
nvim/lua/plugins/nvim-dap.lua
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
config = function()
|
||||
local status, wk = pcall(require, "which-key")
|
||||
|
||||
local dap_breakpoints = {
|
||||
breakpoint = {
|
||||
text = "",
|
||||
texthl = "LspDiagnosticsSignError",
|
||||
linehl = "",
|
||||
numhl = "",
|
||||
},
|
||||
rejected = {
|
||||
text = "",
|
||||
texthl = "LspDiagnosticsSignHint",
|
||||
linehl = "",
|
||||
numhl = "",
|
||||
},
|
||||
stopped = {
|
||||
text = "",
|
||||
texthl = "LspDiagnosticsSignInformation",
|
||||
linehl = "DiagnosticUnderlineInfo",
|
||||
numhl = "LspDiagnosticsSignInformation",
|
||||
},
|
||||
}
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", dap_breakpoints.breakpoint)
|
||||
vim.fn.sign_define("DapStopped", dap_breakpoints.stopped)
|
||||
vim.fn.sign_define("DapBreakpointRejected", dap_breakpoints.rejected)
|
||||
|
||||
if not status then
|
||||
local function nmap(key, action, desc)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>d" .. key,
|
||||
action,
|
||||
{
|
||||
desc = "[D]AP: " .. desc,
|
||||
noremap = true,
|
||||
nowait = false,
|
||||
silent = true
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
nmap("c", "<cmd>lua require'dap'.continue()<CR>", "[C]ontinue")
|
||||
nmap("b", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", "Toggle [B]reakpoint")
|
||||
nmap("i", "<cmd>lua require'dap'.step_into()<CR>", "Step [I]nto")
|
||||
nmap("o", "<cmd>lua require'dap'.step_over()<CR>", "Step [O]ver")
|
||||
nmap("u", "<cmd>lua require'dap'.step_out()<CR>", "[U] Step Out")
|
||||
nmap("x", "<cmd>lua require'dap'.terminate()<CR>", "[T]erminate")
|
||||
nmap("q", "<cmd>lua require'dap'.close()<CR>", "[Q]uit")
|
||||
else
|
||||
local keymap = {
|
||||
d = {
|
||||
name = "DAP",
|
||||
c = { "<cmd>lua require'dap'.continue()<CR>", "[C]ontinue" },
|
||||
b = { "<cmd>lua require'dap'.toggle_breakpoint()<CR>", "Toggle [B]reakpoint" },
|
||||
i = { "<cmd>lua require'dap'.step_into()<CR>", "Step [I]nto" },
|
||||
o = { "<cmd>lua require'dap'.step_over()<CR>", "Step [O]ver" },
|
||||
u = { "<cmd>lua require'dap'.step_out()<CR>", "[U] Step Out" },
|
||||
x = { "<cmd>lua require'dap'.terminate()<CR>", "[T]erminate" },
|
||||
q = { "<cmd>lua require'dap'.close()<CR>", "[Q]uit" },
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
mode = "n",
|
||||
prefix = "<leader>",
|
||||
buffer = nil,
|
||||
silent = true,
|
||||
noremap = true,
|
||||
nowait = false,
|
||||
}
|
||||
wk.register(keymap, opts)
|
||||
end
|
||||
end
|
||||
}
|
||||
7
nvim/lua/plugins/rose-pine.lua
Normal file
7
nvim/lua/plugins/rose-pine.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"rose-pine/nvim",
|
||||
name = "rose-pine",
|
||||
opts = function()
|
||||
vim.cmd.colorscheme("rose-pine")
|
||||
end
|
||||
}
|
||||
6
nvim/lua/plugins/telescope-dap.lua
Normal file
6
nvim/lua/plugins/telescope-dap.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
dependencies = {
|
||||
'mfussenegger/nvim-dap'
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/telescope-file-browser.lua
Normal file
8
nvim/lua/plugins/telescope-file-browser.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
enabled = true,
|
||||
}
|
||||
5
nvim/lua/plugins/telescope-fzf-native.lua
Normal file
5
nvim/lua/plugins/telescope-fzf-native.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make',
|
||||
enabled = true,
|
||||
}
|
||||
95
nvim/lua/plugins/telescope.lua
Normal file
95
nvim/lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
version = "0.1.2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
local fb_actions = require "telescope".extensions.file_browser.actions
|
||||
|
||||
local function telescope_buffer_dir()
|
||||
return vim.fn.expand("%:p:h")
|
||||
end
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
n = {
|
||||
['q'] = actions.close
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
file_browser = {
|
||||
theme = "dropdown",
|
||||
hijack_netrw = false,
|
||||
hidden = true,
|
||||
mappings = {
|
||||
['i'] = {
|
||||
['<C-w>'] = function() vim.cmd("normal vbd") end,
|
||||
['<C-j>'] = function(bufnr) actions.move_selection_next(bufnr) end,
|
||||
['<C-k>'] = function(bufnr) actions.move_selection_previous(bufnr) end,
|
||||
['<C-s>'] = function(bufnr) actions.select_vertical(bufnr) end,
|
||||
},
|
||||
['n'] = {
|
||||
['a'] = fb_actions.create,
|
||||
['h'] = fb_actions.goto_parent_dir,
|
||||
['/'] = function() vim.cmd("startinsert") end,
|
||||
['d'] = fb_actions.remove,
|
||||
['e'] = fb_actions.change_cwd,
|
||||
['<C-s>'] = function(bufnr) actions.select_vertical(bufnr) end,
|
||||
['<C-a>'] = function(bufnr) actions.toggle_all(bufnr) end,
|
||||
['<C-d>'] = function(bufnr) actions.move_selection_next(bufnr) end,
|
||||
['<C-u>'] = function(bufnr) actions.move_selection_previous(bufnr) end,
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
pcall(telescope.load_extension, "file_browser")
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
pcall(telescope.load_extension, "dap")
|
||||
|
||||
-- Builtin pickers
|
||||
vim.keymap.set("n", "<leader>sf", function()
|
||||
builtin.find_files({ no_ignore = false, hidden = true })
|
||||
end, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp Tags" })
|
||||
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch [B]uffers" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
vim.keymap.set("n", "gr", builtin.lsp_references, { desc = "[G]o to [R]eferences", noremap = true })
|
||||
|
||||
-- Git pickers
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
||||
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "List [G]it [S]tatus" })
|
||||
vim.keymap.set("n", "<leader>gh", builtin.git_stash, { desc = "List [G]it [S]tash" })
|
||||
vim.keymap.set("n", "<leader>gbb", builtin.git_branches, { desc = "List [G]it [B]ranches" })
|
||||
vim.keymap.set("n", "<leader>gc", builtin.git_bcommits, { desc = "List Buffer [G]it [C]ommits" })
|
||||
|
||||
-- File Browser Ext
|
||||
vim.keymap.set("n", "<leader>fs",
|
||||
function()
|
||||
telescope.extensions.file_browser.file_browser({
|
||||
path = "%:p:h",
|
||||
cwd = telescope_buffer_dir(),
|
||||
respect_gitignore = false,
|
||||
hidden = true,
|
||||
grouped = true,
|
||||
previewer = false,
|
||||
initial_mode = "normal",
|
||||
layout_config = { height = 40 }
|
||||
})
|
||||
end, { desc = "Open [F]ile [S]ystem Menu" })
|
||||
|
||||
vim.keymap.set('n', '<leader>/', function()
|
||||
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = '[/] Fuzzily serach in current buffer' })
|
||||
end
|
||||
}
|
||||
5
nvim/lua/plugins/todo-comments.lua
Normal file
5
nvim/lua/plugins/todo-comments.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
}
|
||||
97
nvim/lua/plugins/treesitter.lua
Normal file
97
nvim/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ":TSUpdate",
|
||||
event = {
|
||||
"BufReadPost",
|
||||
"BufNewFile"
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
treesitter.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"vimdoc",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"c",
|
||||
"lua",
|
||||
"rust",
|
||||
"go",
|
||||
"gosum",
|
||||
"gomod",
|
||||
},
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
auto_install = true,
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<leader>c',
|
||||
node_incremental = "<C-p>",
|
||||
scope_incremental = "<C-s>",
|
||||
node_decremental = "<M-p>"
|
||||
}
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
['aa'] = '@parameter.outer',
|
||||
['ia'] = '@parameter.inner',
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']m'] = '@function.outer',
|
||||
[']]'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']M'] = '@function.outer',
|
||||
[']['] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[m'] = '@function.outer',
|
||||
['[['] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[M'] = '@function.outer',
|
||||
['[]'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
['<leader>]'] = '@parameter.inner',
|
||||
},
|
||||
swap_previous = {
|
||||
['<leader>['] = '@parameter.inner',
|
||||
},
|
||||
},
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
enable_close_on_slash = false,
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
22
nvim/lua/plugins/undotree.lua
Normal file
22
nvim/lua/plugins/undotree.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"mbbill/undotree",
|
||||
keys = {
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Toggle Undotree" },
|
||||
},
|
||||
config = function()
|
||||
local has_persistent_undo = vim.api.nvim_call_function("has", { "persistent_undo" })
|
||||
|
||||
if has_persistent_undo then
|
||||
local target_path = vim.api.nvim_call_function("expand", { "~/.undodir" })
|
||||
|
||||
local is_directory = vim.api.nvim_call_function("isdirectory", { target_path })
|
||||
|
||||
if not is_directory then
|
||||
vim.api.nvim_call_function("mkdir", { target_path, "p", 0700 })
|
||||
end
|
||||
|
||||
vim.opt.undodir = target_path
|
||||
vim.opt.undofile = true
|
||||
end
|
||||
end
|
||||
}
|
||||
14
nvim/lua/plugins/which-key.lua
Normal file
14
nvim/lua/plugins/which-key.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
vim.opt.timeout = true
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.setup()
|
||||
end,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue