add more neovim plugins and alias eza for ls in zsh
This commit is contained in:
parent
b2322f2877
commit
874cd444ba
13 changed files with 228 additions and 13 deletions
|
@ -1,27 +1,34 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"auto-session": { "branch": "main", "commit": "af2219b9fa99c1d7ac409bd9eac094c459d3f52d" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "700c4a25caacbb4648c9a27972c2fe203948e0c2" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "38d6b74b63dc410ac5d7f4bb4c62dfeec74e366a" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "02893eeb9d6e8503817bd52385e111cba9a90500" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "bd7c76375a511994c9ca8d69441f134dc10ae3bd" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "71a8e8b4b6ebab39765615334d4241a18090a651" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "06fe07d7523ba8c755fac7c913fceba43b1720ee" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"tagbar": { "branch": "master", "commit": "0815b5455c792a610d28ff3e7981642c9cf05d62" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "60b0ac3772e991bc194207afc28368a5f15d913a" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "81c867c5f638597a82c82094dcb90ed42444dabc" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "58a3acfc6d8d819324dab4c87068596319032e64" },
|
||||
"vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "64d6cafb9dcbacce18c26d7daf617ebb96b273f3" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" }
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
vim.g.netrw_liststyle = 3
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
|
@ -9,6 +8,33 @@ opt.number = true
|
|||
opt.autoread = true -- automatically reload modified files
|
||||
opt.wildmenu = true -- handle autocompletion menu
|
||||
|
||||
opt.wrap = false
|
||||
opt.list = true
|
||||
--opt.listchars = {
|
||||
-- { tab = '>' },
|
||||
-- { trail = '▂' },
|
||||
-- { extends = '»' },
|
||||
-- { precedes = '«' },
|
||||
--}
|
||||
|
||||
opt.modelines = 5
|
||||
opt.matchtime = 1
|
||||
opt.tabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.autoindent = true
|
||||
opt.scrolloff = 7
|
||||
opt.spell = true -- enable spellcheck
|
||||
|
||||
opt.ignorecase = true -- ignore case while searching
|
||||
opt.smartcase = true -- ...unless mixed case is used in search terms
|
||||
|
||||
opt.backspace = "indent,eol,start" -- allow backspace on indent, eol, or insert mode start position
|
||||
opt.cursorline = true
|
||||
opt.swapfile = false -- disable swap file
|
||||
|
||||
-- use system clipboard as default register
|
||||
opt.clipboard:append("unnamedplus")
|
||||
|
||||
-- utility functions for key mappings
|
||||
function ToggleLineNumbering()
|
||||
vim.o.number = not vim.o.number
|
||||
|
@ -18,8 +44,6 @@ end
|
|||
-- keymappings
|
||||
local keymap = vim.keymap
|
||||
|
||||
keymap.set('n', '<leader>n', ':lua ToggleLineNumbering()<CR>', {desc="Toggle line numbering"})
|
||||
|
||||
keymap.set('', '<C-n>', ':bnext<CR>', {desc="Jump to next buffer"})
|
||||
keymap.set('', '<C-p>', ':bprev<CR>', {desc="Jump to previous buffer"})
|
||||
|
||||
|
@ -28,11 +52,24 @@ keymap.set('', '<C-j>', '<C-W>j', {desc="Focus window down"})
|
|||
keymap.set('', '<C-k>', '<C-W>k', {desc="Focus window up"})
|
||||
keymap.set('', '<C-l>', '<C-W>l', {desc="Focus window right"})
|
||||
|
||||
keymap.set('v', '<C-o>', ':sort<CR>', {desc="Sort selected lines alphanumerically"})
|
||||
keymap.set('n', '<F7>', 'mzgg=G`z<CR>', {desc="Auto-format entire document"})
|
||||
|
||||
keymap.set('n', '<leader>pu', ':Lazy update<CR>', {desc="Update plugins managed by Lazy"})
|
||||
keymap.set('n', '<leader>pi', ':Lazy install<CR>', {desc="Install missing plugins managed by Lazy"})
|
||||
keymap.set('n', '<leader>pc', ':Lazy clean<CR>', {desc="Clean plugins managed by Lazy"})
|
||||
|
||||
keymap.set('n', 'zn', ']s', {desc="Jump to next misspelling"})
|
||||
keymap.set('n', 'zp', '[s', {desc="Jump to previous misspelling"})
|
||||
keymap.set('n', 'zf', '<Esc>1z=', {desc="Replace misspelling with firest suggested from dictionary"})
|
||||
|
||||
keymap.set('n', '<leader>n', ':lua ToggleLineNumbering()<CR>', {desc="Toggle line numbering"})
|
||||
keymap.set('n', '<leader>w', ':w!<CR>', {desc="Quicksave"})
|
||||
|
||||
keymap.set('n', '<F7>', 'mzgg=G`z<CR>', {desc="Auto-format entire document"})
|
||||
keymap.set('v', '<C-o>', ':sort<CR>', {desc="Sort selected lines alphanumerically"})
|
||||
-- prefer ripgrep if available
|
||||
if vim.fn.executable('rg') == 1 then
|
||||
vim.o.grepprg = 'rg --vimgrep'
|
||||
end
|
||||
|
||||
-- :W to save with sudo
|
||||
-- vim.api.nvim_create_user_command('')
|
||||
|
|
11
.config/nvim/lua/klowner/plugins/auto-session.lua
Normal file
11
.config/nvim/lua/klowner/plugins/auto-session.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"rmagatti/auto-session",
|
||||
config = function ()
|
||||
require('auto-session').setup({
|
||||
auto_restore_enabled = false,
|
||||
})
|
||||
local keymap = vim.keymap
|
||||
keymap.set('n', '<leader>wr', '<cmd>SessionRestore<cr>', { desc = "Restore session for cwd" })
|
||||
keymap.set('n', '<leader>ws', '<cmd>SessionSave<cr>', { desc = "Save session for cwd" })
|
||||
end
|
||||
}
|
11
.config/nvim/lua/klowner/plugins/bufferline.lua
Normal file
11
.config/nvim/lua/klowner/plugins/bufferline.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
version = "*",
|
||||
opts = {
|
||||
options = {
|
||||
mode = "tabs",
|
||||
separator_style = "slant",
|
||||
},
|
||||
},
|
||||
}
|
4
.config/nvim/lua/klowner/plugins/lualine.lua
Normal file
4
.config/nvim/lua/klowner/plugins/lualine.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
}
|
|
@ -37,11 +37,17 @@ return {
|
|||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-l>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-;>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
return cmp.complete_common_string()
|
||||
end
|
||||
fallback()
|
||||
end, {'i','c'}),
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
|
|
12
.config/nvim/lua/klowner/plugins/style.lua
Normal file
12
.config/nvim/lua/klowner/plugins/style.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'folke/tokyonight.nvim',
|
||||
priority = 1000,
|
||||
config = function ()
|
||||
require('tokyonight').setup({
|
||||
style = 'night',
|
||||
on_colors = function () end,
|
||||
on_highlights = function () end,
|
||||
})
|
||||
vim.cmd('colorscheme tokyonight')
|
||||
end,
|
||||
}
|
|
@ -30,6 +30,7 @@ return {
|
|||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
|
||||
["<C-t>"] = require("trouble.sources.telescope").open,
|
||||
['<esc>'] = actions.close, -- close immediately when escape is pressed
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -40,6 +41,9 @@ return {
|
|||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
-- TODO: something
|
||||
keymap.set("n", ";", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
|
||||
keymap.set("n", "<leader>/", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
|
||||
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
|
||||
keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
|
||||
|
|
21
.config/nvim/lua/klowner/plugins/todo-comments.lua
Normal file
21
.config/nvim/lua/klowner/plugins/todo-comments.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local todo_comments = require("todo-comments")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "]t", function()
|
||||
todo_comments.jump_next()
|
||||
end, { desc = "Next todo comment" })
|
||||
|
||||
keymap.set("n", "[t", function()
|
||||
todo_comments.jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
|
||||
todo_comments.setup()
|
||||
end,
|
||||
}
|
57
.config/nvim/lua/klowner/plugins/treesitter.lua
Normal file
57
.config/nvim/lua/klowner/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-treesitter plugin
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
-- configure treesitter
|
||||
treesitter.setup({ -- enable syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
-- enable indentation
|
||||
indent = { enable = true },
|
||||
-- enable autotagging (w/ nvim-ts-autotag plugin)
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
-- ensure these language parsers are installed
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"yaml",
|
||||
"html",
|
||||
"css",
|
||||
"prisma",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"svelte",
|
||||
"graphql",
|
||||
"bash",
|
||||
"lua",
|
||||
"vim",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"query",
|
||||
"vimdoc",
|
||||
"c",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
35
.config/nvim/lua/klowner/plugins/vim-tree.lua
Normal file
35
.config/nvim/lua/klowner/plugins/vim-tree.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = function ()
|
||||
local nvimtree = require('nvim-tree')
|
||||
|
||||
-- recommended settings from the nvim-tree documentation
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
nvimtree.setup({
|
||||
view = {
|
||||
width = 35,
|
||||
relativenumber = true,
|
||||
},
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
window_picker = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
git = {
|
||||
ignore = false
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '\\e', '<cmd>NvimTreeToggle<cr>', {desc = "Toggle file explorer" })
|
||||
end
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue