in progress: add fzf, git, which-key
This commit is contained in:
parent
3d4bbb5710
commit
1bf7a8bee0
12 changed files with 120 additions and 18 deletions
|
|
@ -16,4 +16,12 @@ require("keymaps")
|
|||
require("clipboard")
|
||||
require("options")
|
||||
|
||||
require("lazy").setup("plugins")
|
||||
require("lazy").setup({
|
||||
import = "plugins",
|
||||
install = {
|
||||
colorscheme = { "rose-pine" },
|
||||
}
|
||||
})
|
||||
|
||||
-- set theme
|
||||
vim.cmd.colorscheme("rose-pine")
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "176e85eeb63f1a5970d6b88f1725039d85ca0055" },
|
||||
"LuaSnip": { "branch": "master", "commit": "a658ae2906344a1d2b9c507738e585cf68e685c7" },
|
||||
"LuaSnip": { "branch": "master", "commit": "45a4e899ca8f54936fe32ead6bba65f2a8d42e12" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "dc2962f7fce953a2a98e7c6d3d7fc4c1d1f66758" },
|
||||
"fzf": { "branch": "master", "commit": "0130f64934d2a3ac4f5639ed16cf3dbcfb38240b" },
|
||||
"fzf-lua": { "branch": "main", "commit": "359f3e9eccbc38a6158f57e75aa2a3c525abc476" },
|
||||
"git.nvim": { "branch": "main", "commit": "7a342e61f28e321ef08e00fca4be74ff3ef88335" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "48c3ae8ec74cb83f9570ceb0c5ab8217db7a2220" },
|
||||
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "5af331ea65418dc9361769891921fdee4bcc837a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "da8b00581a52f5f87ad2aba9f52171fda7491f18" },
|
||||
"lsp-zero.nvim": { "branch": "v2.x", "commit": "7b9627c2cb50906993e194290b2e539c95dfdf47" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "82685fdd0f67a694b244cb058b83761f54664d68" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "796008869e67ef27a5aa5ac44c08ce2a60b89f55" },
|
||||
"mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "e8f7dd7a72de3e7b6626c050a802000e69d53ff0" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "2743dd989e9b932e1b4813a4927d7b84272a14e2" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "deade69789089c3da15237697156334fb3e943f0" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "d9104a1d10023ed9e7eacf68639ad887425246eb" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "b4b94ec387525cb9df4b56eb1a8bf33231a0df47" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" },
|
||||
|
|
@ -23,5 +26,6 @@
|
|||
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" },
|
||||
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
|
||||
"vim-floaterm": { "branch": "master", "commit": "bd0aee3c861d613f56b85bd9eaffdcab459071fd" }
|
||||
"vim-floaterm": { "branch": "master", "commit": "bcaeabf89a92a924031d471395054d84bd88ce2f" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "d871f2b664afd5aed3dc1d1573bef2fb24ce0484" }
|
||||
}
|
||||
|
|
@ -1,6 +1,11 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' },
|
||||
ft = {
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"html"
|
||||
},
|
||||
config = function()
|
||||
local autotag = require('nvim-ts-autotag')
|
||||
autotag.setup()
|
||||
|
|
|
|||
8
.config/nvim/lua/plugins/colorscheme.lua
Normal file
8
.config/nvim/lua/plugins/colorscheme.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"rose-pine/nvim",
|
||||
name = "rose-pine",
|
||||
lazy = true,
|
||||
priority = 1000,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
"voldikss/vim-floaterm",
|
||||
keys = {
|
||||
{ "<leader>gg", "<cmd>FloatermNew lazygit<CR>", desc = "Open lazygit in a floating window" },
|
||||
{ "<leader>gl", "<cmd>FloatermNew lazygit<CR>", desc = "Open lazygit in a floating window" },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
13
.config/nvim/lua/plugins/fzf.lua
Normal file
13
.config/nvim/lua/plugins/fzf.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"ibhagwan/fzf-lua",
|
||||
-- optional for icon support
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
{ "junegunn/fzf", build = "./install --bin" }
|
||||
},
|
||||
config = function()
|
||||
-- calling `setup` is optional for customization
|
||||
require("fzf-lua").setup({})
|
||||
end,
|
||||
enabled = true,
|
||||
}
|
||||
28
.config/nvim/lua/plugins/git.lua
Normal file
28
.config/nvim/lua/plugins/git.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
'dinhhuy258/git.nvim',
|
||||
keys = {
|
||||
{ "<leader>gb", "<cmd>GitBlame<CR>", desc = "Open Git Blame" },
|
||||
{ "<leader>gd", "<cmd>GitDiff<CR>", desc = "Open Git Diff" },
|
||||
{ "<leader>gs", "<cmd>Git status<CR>", desc = "Open Git Status" }
|
||||
},
|
||||
cmd = {
|
||||
"Git",
|
||||
"GitBlame",
|
||||
"GitDiff",
|
||||
},
|
||||
config = function()
|
||||
local git = require('git')
|
||||
|
||||
git.setup({
|
||||
default_keymaps = true,
|
||||
keymaps = {
|
||||
blame = "<leader>gb",
|
||||
quit_blame = "q",
|
||||
diff = "<leader>gd",
|
||||
diff_close = "q",
|
||||
},
|
||||
target_branch = "main",
|
||||
|
||||
})
|
||||
end
|
||||
}
|
||||
|
|
@ -25,6 +25,8 @@ return {
|
|||
lspzero.on_attach(function(client, bufnr)
|
||||
lspzero.default_keymaps({ buffer = bufnr })
|
||||
|
||||
local current_dir = vim.fn.expand("%:p:h")
|
||||
|
||||
-- format with space + f
|
||||
vim.keymap.set("n", "<leader>f", "<cmd>lua vim.lsp.buf.format()<CR>")
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
return {
|
||||
"rose-pine/nvim",
|
||||
name = "rose-pine",
|
||||
config = function ()
|
||||
vim.cmd.colorscheme("rose-pine")
|
||||
end
|
||||
}
|
||||
|
|
@ -52,7 +52,8 @@ return {
|
|||
builtin.find_files({ no_ignore = false, hidden = true })
|
||||
end)
|
||||
vim.keymap.set("n", ";g", builtin.git_files)
|
||||
vim.keymap.set("n", "sf",
|
||||
vim.keymap.set("n", ";h", builtin.help_tags)
|
||||
vim.keymap.set("n", ";d",
|
||||
function()
|
||||
telescope.extensions.file_browser.file_browser({
|
||||
path = "%:p:h",
|
||||
|
|
@ -65,6 +66,18 @@ return {
|
|||
layout_config = { height = 40 }
|
||||
})
|
||||
end)
|
||||
vim.keymap.set("n", ";h", builtin.help_tags)
|
||||
|
||||
local status, wk = pcall(require, "which-key");
|
||||
if status then
|
||||
wk.register({
|
||||
[";"] = {
|
||||
name = "Telescope",
|
||||
f = { desc = "Search files in project" },
|
||||
d = { desc = "Open directory viewer" },
|
||||
g = { desc = "Search git files" },
|
||||
h = { desc = "Search help tags" },
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ":TSUpdate",
|
||||
event = {
|
||||
"BufReadPost",
|
||||
"BufNewFile"
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
|
|
@ -22,6 +26,16 @@ return {
|
|||
context_commentstring = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<leader>c',
|
||||
node_incremental = "<C-p>",
|
||||
scope_incremental = "<C-s>",
|
||||
node_decremental = "<M-p>"
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
|
|
|
|||
14
.config/nvim/lua/plugins/which-key.lua
Normal file
14
.config/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