Update .config/nvim/init.lua
Update .config/nvim/lazy-lock.json Update .config/nvim/lua/config/10_opts.lua Update .config/nvim/lua/config/20_keymaps.lua Update .config/nvim/lua/plugin/00_colorscheme.lua Update .config/nvim/lua/plugin/01_whichkey.lua Update .config/nvim/lua/plugin/03_treesitter.lua Update .config/nvim/lua/plugin/05_fzf.lua Update .config/nvim/lua/plugin/15_lsp.lua Add .config/nvim/lua/plugin/25_git.lua Add .config/nvim/lua/plugin/30_formatting.lua Add .config/nvim/stylua.toml
This commit is contained in:
parent
2d7096e6cb
commit
d463a7b8c9
12 changed files with 181 additions and 72 deletions
|
|
@ -11,12 +11,13 @@
|
||||||
-- ├── plugin/ Plugins for lazy.nvim are in here
|
-- ├── plugin/ Plugins for lazy.nvim are in here
|
||||||
-- ├──── 00_colorscheme.lua Sets theme
|
-- ├──── 00_colorscheme.lua Sets theme
|
||||||
-- ├──── 01_whichkey.lua Displays keymaps on input
|
-- ├──── 01_whichkey.lua Displays keymaps on input
|
||||||
-- ├──── 02_sleuth.lua Auto-adjusting shiftwidth and expandtab based on current file
|
|
||||||
-- ├──── 03_treesitter.lua Does anybody know what this does?
|
-- ├──── 03_treesitter.lua Does anybody know what this does?
|
||||||
-- ├──── 05_fzf.lua Pickers with fzf-lua
|
-- ├──── 05_fzf.lua Pickers with fzf-lua
|
||||||
-- ├──── 10_hop.lua Enables hopping to words in the current buffer
|
-- ├──── 10_hop.lua Enables hopping to words in the current buffer
|
||||||
-- ├──── 15_lsp.lua Mason, LSP configurations
|
-- ├──── 15_lsp.lua Mason, LSP configurations
|
||||||
-- ├──── 20_completion.lua Autocompletion with blink.cmp, and mini.snippets
|
-- ├──── 20_completion.lua Autocompletion with blink.cmp, and mini.snippets
|
||||||
|
-- ├──── 25_git.lua Gitsigns
|
||||||
|
-- ├──── 30_formatting.lua vim-sleuth and conform formatting configs
|
||||||
-- ├ snippets/ Snippets definitions are in here
|
-- ├ snippets/ Snippets definitions are in here
|
||||||
-- ├── package.json Snippet repository metadata
|
-- ├── package.json Snippet repository metadata
|
||||||
-- ├── global.json Global text snippets
|
-- ├── global.json Global text snippets
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,24 @@
|
||||||
{
|
{
|
||||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "02736cf359a3235c6d7d601a2f6bdc909e557513" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "a8458b79a957a6e3e217d84106a0fd4b9470ff4c" },
|
"fzf-lua": { "branch": "main", "commit": "a8458b79a957a6e3e217d84106a0fd4b9470ff4c" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
|
||||||
"helix-nvim": { "branch": "main", "commit": "c2875fb19df7f3624d0ae1c82b063fc14de1d64b" },
|
"helix-nvim": { "branch": "main", "commit": "c2875fb19df7f3624d0ae1c82b063fc14de1d64b" },
|
||||||
"hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" },
|
"hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "db067881fff0fd4be8c00e5bde7492e0e1c77a2f" },
|
"lazy.nvim": { "branch": "main", "commit": "db067881fff0fd4be8c00e5bde7492e0e1c77a2f" },
|
||||||
|
"lazydev.nvim": { "branch": "main", "commit": "371cd7434cbf95606f1969c2c744da31b77fcfa6" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||||
"mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
|
"mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
|
||||||
"mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" },
|
"mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" },
|
||||||
"mini.snippets": { "branch": "main", "commit": "7610dc3aaf7fb09b9cc428273a8ba15ef8aef495" },
|
"mini.snippets": { "branch": "main", "commit": "7610dc3aaf7fb09b9cc428273a8ba15ef8aef495" },
|
||||||
|
"nvim-colorizer.lua": { "branch": "master", "commit": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "a89bfcfd0e44f898341ac8a80ba83ccf6218bef3" },
|
"nvim-lspconfig": { "branch": "master", "commit": "a89bfcfd0e44f898341ac8a80ba83ccf6218bef3" },
|
||||||
"nvim-scissors": { "branch": "main", "commit": "9b4fc66427568b2139480fcc645dd7bb91884ade" },
|
"nvim-scissors": { "branch": "main", "commit": "9b4fc66427568b2139480fcc645dd7bb91884ade" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"nvim-treesitter-context": { "branch": "master", "commit": "ec308c7827b5f8cb2dd0ad303a059c945dd21969" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,42 @@
|
||||||
-- 10_opts.lua
|
-- 10_opts.lua
|
||||||
-- General =================================
|
-- General ===================================
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = " "
|
||||||
vim.o.mouse = ''
|
vim.o.mouse = ""
|
||||||
vim.o.mousescroll = 'ver:25,hor:6'
|
vim.o.mousescroll = "ver:25,hor:6"
|
||||||
vim.o.switchbuf = 'usetab'
|
vim.o.switchbuf = "usetab"
|
||||||
vim.o.undofile = true
|
vim.o.undofile = true
|
||||||
-- UI ======================================
|
-- UI ========================================
|
||||||
vim.o.breakindent = true
|
vim.o.breakindent = true
|
||||||
vim.o.breakindentopt = 'list:-1'
|
vim.o.breakindentopt = "list:-1"
|
||||||
vim.o.colorcolumn = '+1'
|
vim.o.colorcolumn = "+1"
|
||||||
vim.o.cursorline = true
|
vim.o.cursorline = true
|
||||||
vim.o.linebreak = true
|
vim.o.linebreak = true
|
||||||
vim.o.list = true
|
vim.o.list = true
|
||||||
vim.o.relativenumber = true
|
vim.o.relativenumber = true
|
||||||
vim.o.pumheight = 10
|
vim.o.pumheight = 10
|
||||||
vim.o.ruler = false
|
vim.o.ruler = false
|
||||||
vim.o.signcolumn = 'yes'
|
vim.o.signcolumn = "yes"
|
||||||
vim.o.splitbelow = true
|
vim.o.splitbelow = true
|
||||||
vim.o.splitright = true
|
vim.o.splitright = true
|
||||||
vim.o.winborder = 'single'
|
vim.o.winborder = "single"
|
||||||
vim.o.wrap = false
|
vim.o.wrap = false
|
||||||
vim.o.cursorlineopt = 'screenline,number'
|
vim.o.cursorlineopt = "screenline,number"
|
||||||
-- Folds ===================================
|
-- Folds =====================================
|
||||||
vim.o.foldlevel = 10
|
vim.o.foldlevel = 10
|
||||||
vim.o.foldmethod = 'indent'
|
vim.o.foldmethod = "indent"
|
||||||
vim.o.foldnestmax = 10
|
vim.o.foldnestmax = 10
|
||||||
vim.o.foldtext = ''
|
vim.o.foldtext = ""
|
||||||
-- Editing =================================
|
-- Editing ===================================
|
||||||
vim.o.autoindent = true
|
vim.o.autoindent = true
|
||||||
vim.o.expandtab = true
|
vim.o.expandtab = true
|
||||||
vim.o.ignorecase = true
|
vim.o.ignorecase = true
|
||||||
vim.o.incsearch = true
|
vim.o.incsearch = true
|
||||||
vim.o.infercase = true
|
vim.o.infercase = true
|
||||||
vim.o.smartcase = true
|
vim.o.smartcase = true
|
||||||
vim.o.smartindent = true
|
vim.o.smartindent = true
|
||||||
vim.o.virtualedit = 'block'
|
vim.o.virtualedit = "block"
|
||||||
vim.o.iskeyword = '@,48-57,_,192-255,-'
|
vim.o.iskeyword = "@,48-57,_,192-255,-"
|
||||||
vim.o.tabstop = 2
|
vim.o.tabstop = 2
|
||||||
vim.o.shiftwidth = 2
|
vim.o.shiftwidth = 2
|
||||||
|
-- Diagnostic ================================
|
||||||
|
vim.diagnostic.config({ virtual_text = true })
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,17 @@
|
||||||
|
|
||||||
-- Helpers ====================================================
|
-- Helpers ====================================================
|
||||||
local nmap = function(lhs, rhs, desc)
|
local nmap = function(lhs, rhs, desc)
|
||||||
vim.keymap.set('n', lhs, rhs, { desc = desc })
|
vim.keymap.set("n", lhs, rhs, { desc = desc })
|
||||||
end
|
end
|
||||||
local nmap_leader = function(lhs, rhs, desc)
|
local nmap_leader = function(lhs, rhs, desc)
|
||||||
vim.keymap.set('n', '<Leader>' .. lhs, rhs, { desc = desc })
|
vim.keymap.set("n", "<Leader>" .. lhs, rhs, { desc = desc })
|
||||||
end
|
end
|
||||||
-- Keymaps ====================================================
|
-- Keymaps ====================================================
|
||||||
nmap('[p', '<Cmd>exe "put! " . v:register<CR>', 'Paste above')
|
-- stylua: ignore start
|
||||||
nmap(']p', '<Cmd>exe "put " . v:register<Cr>', 'Paste below')
|
nmap('[p', '<Cmd>exe "put! " . v:register<CR>', 'put above')
|
||||||
nmap_leader('ei', '<Cmd>edit $MYVIMRC<CR>', 'init.lua')
|
nmap(']p', '<Cmd>exe "put " . v:register<Cr>', 'put below')
|
||||||
|
nmap_leader('ei', '<Cmd>edit $MYVIMRC<CR>', 'init.lua')
|
||||||
|
nmap_leader('aa', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'lsp code action')
|
||||||
|
nmap_leader('ar', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'lsp rename')
|
||||||
|
nmap_leader('fi', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'lsp find implementation')
|
||||||
|
nmap_leader('fr', '<Cmd>lua vim.lsp.buf.references()<CR>', 'lsp find references')
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'oneslash/helix-nvim', version = "*",
|
"oneslash/helix-nvim",
|
||||||
config = function ()
|
vsersion = "*",
|
||||||
vim.cmd.colorscheme("helix")
|
config = function()
|
||||||
end,
|
vim.cmd.colorscheme("helix")
|
||||||
}
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"catgoose/nvim-colorizer.lua",
|
||||||
|
event = "BufReadPre",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,32 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'folke/which-key.nvim',
|
"folke/which-key.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
preset = "helix",
|
preset = "helix",
|
||||||
delay = function(ctx) return ctx.plugin and 0 or 20 end,
|
delay = function(ctx)
|
||||||
spec = {
|
return ctx.plugin and 0 or 20
|
||||||
{ "<leader>f", group = "fzf" },
|
end,
|
||||||
{ "<leader>s", group = "snippet" },
|
spec = {
|
||||||
{ "<leader>e", group = "edit config" },
|
{ "<leader>f", group = "find" },
|
||||||
|
{ "<leader>a", group = "lsp action" },
|
||||||
|
{ "<leader>s", group = "snippet" },
|
||||||
|
{ "<leader>e", group = "edit config" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>?", function() require("which-key").show({ global = true }) end, desc = "buffer local keymaps" }
|
{
|
||||||
}
|
"<leader>?",
|
||||||
|
function()
|
||||||
|
require("which-key").show({ global = true })
|
||||||
|
end,
|
||||||
|
desc = "buffer local keymaps",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
dependencies = { "mini-nvim/mini.icons" },
|
||||||
|
opts = {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,11 @@ return {
|
||||||
lazy = false,
|
lazy = false,
|
||||||
build = ":TSUpdate"
|
build = ":TSUpdate"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter-context',
|
||||||
|
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||||
|
config = function()
|
||||||
|
require("treesitter-context").setup()
|
||||||
|
end,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,31 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'ibhagwan/fzf-lua',
|
"ibhagwan/fzf-lua",
|
||||||
dependencies = { { 'nvim-mini/mini.icons' }, },
|
dependencies = { { "nvim-mini/mini.icons" } },
|
||||||
opts = {
|
epts = {
|
||||||
winopts = {
|
winopts = {
|
||||||
preview = {
|
preview = {
|
||||||
vertical = "down:65%",
|
vertical = "down:65%",
|
||||||
flip_columns = 120
|
flip_columns = 120,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
files = { git_icons = true, },
|
files = { git_icons = true },
|
||||||
},
|
},
|
||||||
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "f", "<cmd>FzfLua global<CR>", mode = { "n" }, desc = "Fzf everything" },
|
{ '<leader>f"', "<cmd>FzfLua registers<CR>", mode = { "n" }, desc = "fzf registers" },
|
||||||
{ "<leader>fg", "<cmd>FzfLua global<CR>", mode = { "n" }, desc = "Fzf everything" },
|
{ "<leader>fb", "<cmd>FzfLua buffers<CR>", mode = { "n" }, desc = "fzf buffers" },
|
||||||
|
{ "<leader>fc", "<cmd>FzfLua commands<CR>", mode = { "n" }, desc = "fzf commands" },
|
||||||
|
{ "<leader>fe", "<cmd>FzfLua changes<CR>", mode = { "n" }, desc = "fzf edits" },
|
||||||
|
{ "<leader>ff", "<cmd>FzfLua files<CR>", mode = { "n" }, desc = "fzf files" },
|
||||||
|
{ "<leader>fg", "<cmd>FzfLua live_grep<CR>", mode = { "n" }, desc = "fzf grep" },
|
||||||
|
{ "<leader>fh", "<cmd>FzfLua command_history<CR>", mode = { "n" }, desc = "fzf cmd history" },
|
||||||
|
-- <leader>fi --> lsp find implementation
|
||||||
|
{ "<leader>fk", "<cmd>FzfLua keymaps<CR>", mode = { "n" }, desc = "fzf keymaps" },
|
||||||
|
{ "<leader>fl", "<cmd>FzfLua blines<CR>", mode = { "n" }, desc = "fzf bufferlines" },
|
||||||
|
{ "<leader>fo", "<cmd>FzfLua oldfiles<CR>", mode = { "n" }, desc = "fzf oldfiles" },
|
||||||
|
-- <leader>fr --> lsp find references
|
||||||
|
{ "<leader>fs", "<cmd>FzfLua<CR>", mode = { "n" }, desc = "fzf something else" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,19 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'mason-org/mason-lspconfig.nvim',
|
"mason-org/mason-lspconfig.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'mason-org/mason.nvim', opts = {} },
|
{ "mason-org/mason.nvim", opts = {} },
|
||||||
{ 'neovim/nvim-lspconfig' },
|
{ "neovim/nvim-lspconfig" },
|
||||||
}
|
{
|
||||||
|
"folke/lazydev.nvim",
|
||||||
|
ft = "lua",
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
private_dot_config/nvim/lua/plugin/25_git.lua
Normal file
5
private_dot_config/nvim/lua/plugin/25_git.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
},
|
||||||
|
}
|
||||||
39
private_dot_config/nvim/lua/plugin/30_formatting.lua
Normal file
39
private_dot_config/nvim/lua/plugin/30_formatting.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"tpope/vim-sleuth",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
event = { "BufWritePre" },
|
||||||
|
cmd = { "ConformInfo" },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>af",
|
||||||
|
function()
|
||||||
|
require("conform").format({ async = true })
|
||||||
|
end,
|
||||||
|
mode = "",
|
||||||
|
desc = "format buffer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
python = { "isort", "black" },
|
||||||
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
},
|
||||||
|
default_format_opts = {
|
||||||
|
lsp_format = "fallback",
|
||||||
|
},
|
||||||
|
format_on_save = { timeout_ms = 500 },
|
||||||
|
formatters = {
|
||||||
|
shfmt = {
|
||||||
|
append_args = { "-i", "2" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
4
private_dot_config/nvim/stylua.toml
Normal file
4
private_dot_config/nvim/stylua.toml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
column_width = 80
|
||||||
|
indent_type = "Spaces"
|
||||||
|
quote_style = "AutoPreferDouble"
|
||||||
|
indent_width = 2
|
||||||
Loading…
Add table
Add a link
Reference in a new issue