Simplify + add whichkey mappings
This commit is contained in:
@@ -3,3 +3,4 @@
|
|||||||
## Requirements:
|
## Requirements:
|
||||||
* Git
|
* Git
|
||||||
* [ripgrep](https://github.com/BurntSushi/ripgrep)
|
* [ripgrep](https://github.com/BurntSushi/ripgrep)
|
||||||
|
* [fd](https://github.com/sharkdp/fd)
|
||||||
|
|||||||
@@ -1 +1,18 @@
|
|||||||
require("core.settings")
|
local opt = vim.opt
|
||||||
|
local g = vim.g
|
||||||
|
|
||||||
|
g.mapleader = " "
|
||||||
|
|
||||||
|
opt.backup = false
|
||||||
|
opt.swapfile = false
|
||||||
|
opt.termguicolors = true
|
||||||
|
opt.number = true
|
||||||
|
opt.mouse = "a"
|
||||||
|
opt.cursorline = true
|
||||||
|
opt.hidden = true
|
||||||
|
|
||||||
|
-- Indentation
|
||||||
|
opt.expandtab = true
|
||||||
|
opt.smartindent = true
|
||||||
|
opt.shiftwidth = 4
|
||||||
|
opt.tabstop = 4
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
local opt = vim.opt
|
|
||||||
local g = vim.g
|
|
||||||
|
|
||||||
g.mapleader = " "
|
|
||||||
|
|
||||||
opt.backup = false
|
|
||||||
opt.swapfile = false
|
|
||||||
opt.termguicolors = true
|
|
||||||
opt.number = true
|
|
||||||
opt.mouse = "a"
|
|
||||||
opt.cursorline = true
|
|
||||||
opt.hidden = true
|
|
||||||
|
|
||||||
-- Indentation
|
|
||||||
opt.expandtab = true
|
|
||||||
opt.smartindent = true
|
|
||||||
opt.shiftwidth = 4
|
|
||||||
opt.tabstop = 4
|
|
||||||
10
lua/plugins/barbar_nvimtree.lua
Normal file
10
lua/plugins/barbar_nvimtree.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
local nvim_tree_events = require("nvim-tree.events")
|
||||||
|
local bufferline_state = require("bufferline.state")
|
||||||
|
|
||||||
|
nvim_tree_events.on_tree_open(function ()
|
||||||
|
bufferline_state.set_offset(31, "File Tree")
|
||||||
|
end)
|
||||||
|
|
||||||
|
nvim_tree_events.on_tree_close(function ()
|
||||||
|
bufferline_state.set_offset(0)
|
||||||
|
end)
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
require("bufdel").setup {
|
|
||||||
next = "alternate",
|
|
||||||
quit = false
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
require("bufferline").setup {
|
|
||||||
options = {
|
|
||||||
offsets = {{ filetype = "NvimTree", text = "File Explorer" }},
|
|
||||||
tab_size = 20,
|
|
||||||
separator_style = "thin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
lua/plugins/config/catppuccin.lua
Normal file
9
lua/plugins/config/catppuccin.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
require("catppuccin").setup {
|
||||||
|
integrations = {
|
||||||
|
lsp_trouble = true,
|
||||||
|
which_key = true,
|
||||||
|
barbar = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.cmd[[colorscheme catppuccin]]
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
local cmp = require("cmp")
|
|
||||||
|
|
||||||
cmp.setup {
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
mapping = {
|
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
|
||||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = true,
|
|
||||||
},
|
|
||||||
["<Tab>"] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif require("luasnip").expand_or_jumpable() then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
["<S-Tab>"] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif require("luasnip").jumpable(-1) then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "nvim_lua" },
|
|
||||||
{ name = "path" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,9 @@ require("lualine").setup {
|
|||||||
options = {
|
options = {
|
||||||
theme = "catppuccin"
|
theme = "catppuccin"
|
||||||
},
|
},
|
||||||
|
|
||||||
extensions = {
|
extensions = {
|
||||||
"nvim-tree",
|
"nvim-tree",
|
||||||
"toggleterm",
|
"toggleterm"
|
||||||
"quickfix"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
local luasnip = require("luasnip")
|
|
||||||
|
|
||||||
luasnip.config.set_config {
|
|
||||||
history = true,
|
|
||||||
updateevents = "TextChanged,TextChangedI"
|
|
||||||
}
|
|
||||||
|
|
||||||
require("luasnip/loaders/from_vscode").load()
|
|
||||||
@@ -1,25 +1,24 @@
|
|||||||
local g = vim.g
|
local g = vim.g
|
||||||
|
|
||||||
g.nvim_tree_highlight_opened_files = 1
|
g.nvim_tree_git_hl = 1
|
||||||
g.nvim_tree_highlight_opened_files = 1
|
g.nvim_tree_highlight_opened_files = 1
|
||||||
g.nvim_tree_group_empty = 1
|
g.nvim_tree_group_empty = 1
|
||||||
g.nvim_tree_root_folder_modifier = table.concat { ":t:gs?$?/..", string.rep(" ", 1000), "?:gs?^??" }
|
g.nvim_tree_create_in_closed_folder = 1
|
||||||
|
|
||||||
require("nvim-tree").setup {
|
require("nvim-tree").setup {
|
||||||
disable_netrw = true,
|
disable_netrw = true,
|
||||||
ignore_ft_on_setup = { "dashboard" },
|
|
||||||
hijack_cursor = true,
|
hijack_cursor = true,
|
||||||
update_cwd = true,
|
update_cwd = true,
|
||||||
|
|
||||||
update_focused_file = {
|
update_focused_file = {
|
||||||
enable = true,
|
enable = true,
|
||||||
update_cwd = true
|
update_cwd = true
|
||||||
},
|
},
|
||||||
git = {
|
|
||||||
ignore = false
|
|
||||||
},
|
|
||||||
view = {
|
view = {
|
||||||
hide_root_folder = true
|
hide_root_folder = true
|
||||||
},
|
},
|
||||||
|
|
||||||
renderer = {
|
renderer = {
|
||||||
indent_markers = {
|
indent_markers = {
|
||||||
enable = true
|
enable = true
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
require("nvim-treesitter.configs").setup {
|
require("nvim-treesitter.configs").setup {
|
||||||
ensure_installed = {
|
ensure_installed = { "lua", "bash", "cpp", "css", "go", "gomod", "html", "javascript", "json", "make", "python", "typescript" },
|
||||||
"lua",
|
|
||||||
"typescript",
|
|
||||||
"tsx",
|
|
||||||
"json",
|
|
||||||
"javascript"
|
|
||||||
},
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true
|
||||||
use_languagetree = true
|
|
||||||
},
|
},
|
||||||
|
|
||||||
matchup = {
|
matchup = {
|
||||||
enable = true
|
enable = true
|
||||||
},
|
|
||||||
context_commentstring = {
|
|
||||||
enable = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,46 @@
|
|||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
|
|
||||||
wk.setup {
|
wk.setup {
|
||||||
ignore_missing = true
|
ignore_missing = false
|
||||||
}
|
}
|
||||||
|
|
||||||
wk.register({
|
wk.register({
|
||||||
["<leader>"] = {
|
["<leader>"] = {
|
||||||
f = {
|
-- Barbar
|
||||||
name = "Files",
|
|
||||||
f = { "<cmd>Telescope find_files<CR>", "Find File" },
|
|
||||||
g = { "<cmd>Telescope live_grep<CR>", "Live Grep" }
|
|
||||||
},
|
|
||||||
b = {
|
b = {
|
||||||
name = "Buffers",
|
name = "Barbar",
|
||||||
b = { "<cmd>Telescope buffers<CR>", "Find Buffers" },
|
x = { "<cmd>BufferClose<CR>", "Close Buffer" },
|
||||||
x = { "<cmd>BufDel<CR>", "Close Buffer" }
|
n = { "<cmd>BufferMoveNext<CR>", "Move Next" },
|
||||||
},
|
m = { "<cmd>BufferMovePrevious<CR>", "Move Previous" },
|
||||||
t = {
|
|
||||||
name = "NvimTree",
|
p = {
|
||||||
t = { "<cmd>NvimTreeToggle<CR>", "NvimTree Toggle" },
|
name = "Pinned Buffers",
|
||||||
f = { "<cmd>NvimTreeFocus<CR>", "NvimTree Focus" }
|
p = { "<cmd>BufferPin<CR>", "Pin Buffer" },
|
||||||
|
x = { "<cmd>BufferCloseAllButPinned<CR>", "Close All But Pinned" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
t = {
|
||||||
|
name = "Telescope",
|
||||||
|
w = { "<cmd>Telescope live_grep<CR>", "Live Grep" },
|
||||||
|
f = { "<cmd>Telescope fd<CR>", "Find Files" },
|
||||||
|
c = { "<cmd>Telescope current_buffer_fuzzy_find<CR>", "Find In Current Buffer" },
|
||||||
|
b = { "<cmd>Telescope buffers<CR>", "Buffers" },
|
||||||
|
k = { "<cmd>Telescope keymaps<CR>", "Keymaps" }
|
||||||
|
},
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
name = "Git",
|
name = "Git",
|
||||||
c = { "<cmd>Telescope git_commits<CR>", "Git Commits" },
|
|
||||||
s = { "<cmd>Telescope git_status<CR>", "Git Status" },
|
|
||||||
b = { "<cmd>Gitsigns blame_line<CR>", "Blame Line" },
|
b = { "<cmd>Gitsigns blame_line<CR>", "Blame Line" },
|
||||||
d = { "<cmd>Gitsigns diffthis<CR>", "Diff This" }
|
d = { "<cmd>Gitsigns diffthis<CR>", "Diff" }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
["<TAB>"] = { "<cmd>BufferLineCycleNext<CR>", "Next Buffer" }
|
-- NvimTree
|
||||||
|
["<C-n>"] = { "<cmd>NvimTreeToggle<CR>", "NvimTree Toggle" },
|
||||||
|
|
||||||
|
-- Barbar (switching buffers)
|
||||||
|
["<TAB>"] = { "<cmd>BufferNext<CR>", "Next Buffer" },
|
||||||
|
["<S-TAB>"] = { "<cmd>BufferPrevious<CR>", "Previous Buffer" }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ if fn.empty(fn.glob(install_path)) > 0 then
|
|||||||
end
|
end
|
||||||
|
|
||||||
require("plugins.setup")
|
require("plugins.setup")
|
||||||
|
require("plugins.barbar_nvimtree")
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
local M = {}
|
|
||||||
|
|
||||||
M.bufdel = {
|
|
||||||
closeBuffer = "<leader>x"
|
|
||||||
}
|
|
||||||
|
|
||||||
M.bufferline = {
|
|
||||||
nextBuffer = "<TAB>",
|
|
||||||
prevBuffer = "<S-Tab"
|
|
||||||
}
|
|
||||||
|
|
||||||
M.gitsigns = {
|
|
||||||
blameLine = "<leader>gb",
|
|
||||||
diffThis = "<leader>gd"
|
|
||||||
}
|
|
||||||
|
|
||||||
M.nvimtree = {
|
|
||||||
toggle = "<C-n>",
|
|
||||||
focus = "<leader>e"
|
|
||||||
}
|
|
||||||
|
|
||||||
M.telescope = {
|
|
||||||
buffers = "<leader>fb",
|
|
||||||
diagnostics = "<leader>fd",
|
|
||||||
liveGrep = "<leader>fw",
|
|
||||||
files = "<leader>ff",
|
|
||||||
gitCommits = "<leader>fgc",
|
|
||||||
gitStatus = "<leader>fgs"
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -7,7 +7,7 @@ require("packer").startup(function(use)
|
|||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
as = "catppuccin",
|
as = "catppuccin",
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd[[colorscheme catppuccin]]
|
require("plugins.config.catppuccin")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,34 +39,28 @@ require("packer").startup(function(use)
|
|||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"ojroques/nvim-bufdel",
|
"romgrk/barbar.nvim",
|
||||||
config = function()
|
requires = "kyazdani42/nvim-web-devicons"
|
||||||
require("plugins.config.bufdel")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"akinsho/bufferline.nvim",
|
|
||||||
requires = {
|
|
||||||
"kyazdani42/nvim-web-devicons",
|
|
||||||
"ojroques/nvim-bufdel"
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("plugins.config.bufferline")
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
requires = { "kyazdani42/nvim-web-devicons", opt = true },
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.config.lualine")
|
require("plugins.config.lualine")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
"kyazdani42/nvim-tree.lua",
|
||||||
|
requires = "kyazdani42/nvim-web-devicons",
|
||||||
|
config = function()
|
||||||
|
require("plugins.config.nvimtree")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
requires = "nvim-lua/plenary.nvim",
|
|
||||||
config = function()
|
config = function()
|
||||||
require("gitsigns").setup()
|
require("gitsigns").setup()
|
||||||
end
|
end
|
||||||
@@ -79,22 +73,6 @@ require("packer").startup(function(use)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use {
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
requires = "nvim-lua/plenary.nvim",
|
|
||||||
config = function()
|
|
||||||
require("todo-comments").setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"kyazdani42/nvim-tree.lua",
|
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
|
||||||
config = function()
|
|
||||||
require("plugins.config.nvimtree")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use "JoosepAlviste/nvim-ts-context-commentstring"
|
use "JoosepAlviste/nvim-ts-context-commentstring"
|
||||||
|
|
||||||
use {
|
use {
|
||||||
@@ -106,14 +84,13 @@ require("packer").startup(function(use)
|
|||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
requires = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
run = "make"
|
run = "make"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
use {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
requires = "nvim-lua/plenary.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.config.telescope")
|
require("plugins.config.telescope")
|
||||||
end
|
end
|
||||||
@@ -126,99 +103,6 @@ require("packer").startup(function(use)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- LSP
|
|
||||||
use "neovim/nvim-lspconfig"
|
|
||||||
|
|
||||||
use {
|
|
||||||
"ray-x/lsp_signature.nvim",
|
|
||||||
after = "nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
require("lsp_signature").setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"rafamadriz/friendly-snippets",
|
|
||||||
module = "cmp_nvim_lsp",
|
|
||||||
event = "InsertCharPre"
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
after = "friendly-snippets",
|
|
||||||
config = function()
|
|
||||||
require("plugins.config.cmp")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
wants = "friendly-snippets",
|
|
||||||
after = "nvim-cmp",
|
|
||||||
config = function()
|
|
||||||
require("plugins.config.luasnip")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
after = "LuaSnip"
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"hrsh7th/cmp-nvim-lua",
|
|
||||||
after = "cmp_luasnip"
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
after = "cmp-nvim-lua"
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
after = "cmp-nvim-lsp"
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
after = "cmp-buffer"
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"williamboman/nvim-lsp-installer",
|
|
||||||
requires = "neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
local lspInstaller = require("nvim-lsp-installer")
|
|
||||||
|
|
||||||
lspInstaller.on_server_ready(function(server)
|
|
||||||
local opts = {}
|
|
||||||
server:setup(opts)
|
|
||||||
vim.cmd [[ do User LspAttachBuffers ]]
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
config = function()
|
|
||||||
require("nvim-autopairs").setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"simrat39/symbols-outline.nvim",
|
|
||||||
cmd = "SymbolsOutline"
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
|
||||||
config = function()
|
|
||||||
require("trouble").setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"goolord/alpha-nvim",
|
"goolord/alpha-nvim",
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
requires = "kyazdani42/nvim-web-devicons",
|
||||||
|
|||||||
Reference in New Issue
Block a user