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
|
|
@ -1,41 +1,42 @@
|
|||
-- 10_opts.lua
|
||||
-- General =================================
|
||||
vim.g.mapleader = ' '
|
||||
vim.o.mouse = ''
|
||||
vim.o.mousescroll = 'ver:25,hor:6'
|
||||
vim.o.switchbuf = 'usetab'
|
||||
vim.o.undofile = true
|
||||
-- UI ======================================
|
||||
vim.o.breakindent = true
|
||||
vim.o.breakindentopt = 'list:-1'
|
||||
vim.o.colorcolumn = '+1'
|
||||
vim.o.cursorline = true
|
||||
vim.o.linebreak = true
|
||||
vim.o.list = true
|
||||
vim.o.relativenumber = true
|
||||
vim.o.pumheight = 10
|
||||
vim.o.ruler = false
|
||||
vim.o.signcolumn = 'yes'
|
||||
vim.o.splitbelow = true
|
||||
vim.o.splitright = true
|
||||
vim.o.winborder = 'single'
|
||||
vim.o.wrap = false
|
||||
vim.o.cursorlineopt = 'screenline,number'
|
||||
-- Folds ===================================
|
||||
vim.o.foldlevel = 10
|
||||
vim.o.foldmethod = 'indent'
|
||||
vim.o.foldnestmax = 10
|
||||
vim.o.foldtext = ''
|
||||
-- Editing =================================
|
||||
vim.o.autoindent = true
|
||||
vim.o.expandtab = true
|
||||
vim.o.ignorecase = true
|
||||
vim.o.incsearch = true
|
||||
vim.o.infercase = true
|
||||
vim.o.smartcase = true
|
||||
vim.o.smartindent = true
|
||||
vim.o.virtualedit = 'block'
|
||||
vim.o.iskeyword = '@,48-57,_,192-255,-'
|
||||
vim.o.tabstop = 2
|
||||
vim.o.shiftwidth = 2
|
||||
|
||||
-- General ===================================
|
||||
vim.g.mapleader = " "
|
||||
vim.o.mouse = ""
|
||||
vim.o.mousescroll = "ver:25,hor:6"
|
||||
vim.o.switchbuf = "usetab"
|
||||
vim.o.undofile = true
|
||||
-- UI ========================================
|
||||
vim.o.breakindent = true
|
||||
vim.o.breakindentopt = "list:-1"
|
||||
vim.o.colorcolumn = "+1"
|
||||
vim.o.cursorline = true
|
||||
vim.o.linebreak = true
|
||||
vim.o.list = true
|
||||
vim.o.relativenumber = true
|
||||
vim.o.pumheight = 10
|
||||
vim.o.ruler = false
|
||||
vim.o.signcolumn = "yes"
|
||||
vim.o.splitbelow = true
|
||||
vim.o.splitright = true
|
||||
vim.o.winborder = "single"
|
||||
vim.o.wrap = false
|
||||
vim.o.cursorlineopt = "screenline,number"
|
||||
-- Folds =====================================
|
||||
vim.o.foldlevel = 10
|
||||
vim.o.foldmethod = "indent"
|
||||
vim.o.foldnestmax = 10
|
||||
vim.o.foldtext = ""
|
||||
-- Editing ===================================
|
||||
vim.o.autoindent = true
|
||||
vim.o.expandtab = true
|
||||
vim.o.ignorecase = true
|
||||
vim.o.incsearch = true
|
||||
vim.o.infercase = true
|
||||
vim.o.smartcase = true
|
||||
vim.o.smartindent = true
|
||||
vim.o.virtualedit = "block"
|
||||
vim.o.iskeyword = "@,48-57,_,192-255,-"
|
||||
vim.o.tabstop = 2
|
||||
vim.o.shiftwidth = 2
|
||||
-- Diagnostic ================================
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
|
|
|
|||
|
|
@ -2,12 +2,17 @@
|
|||
|
||||
-- Helpers ====================================================
|
||||
local nmap = function(lhs, rhs, desc)
|
||||
vim.keymap.set('n', lhs, rhs, { desc = desc })
|
||||
vim.keymap.set("n", lhs, rhs, { desc = desc })
|
||||
end
|
||||
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
|
||||
-- Keymaps ====================================================
|
||||
nmap('[p', '<Cmd>exe "put! " . v:register<CR>', 'Paste above')
|
||||
nmap(']p', '<Cmd>exe "put " . v:register<Cr>', 'Paste below')
|
||||
nmap_leader('ei', '<Cmd>edit $MYVIMRC<CR>', 'init.lua')
|
||||
-- stylua: ignore start
|
||||
nmap('[p', '<Cmd>exe "put! " . v:register<CR>', 'put above')
|
||||
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 {
|
||||
{
|
||||
'oneslash/helix-nvim', version = "*",
|
||||
config = function ()
|
||||
vim.cmd.colorscheme("helix")
|
||||
end,
|
||||
}
|
||||
{
|
||||
"oneslash/helix-nvim",
|
||||
vsersion = "*",
|
||||
config = function()
|
||||
vim.cmd.colorscheme("helix")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"catgoose/nvim-colorizer.lua",
|
||||
event = "BufReadPre",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,32 @@
|
|||
return {
|
||||
{
|
||||
'folke/which-key.nvim',
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
preset = "helix",
|
||||
delay = function(ctx) return ctx.plugin and 0 or 20 end,
|
||||
spec = {
|
||||
{ "<leader>f", group = "fzf" },
|
||||
{ "<leader>s", group = "snippet" },
|
||||
{ "<leader>e", group = "edit config" },
|
||||
delay = function(ctx)
|
||||
return ctx.plugin and 0 or 20
|
||||
end,
|
||||
spec = {
|
||||
{ "<leader>f", group = "find" },
|
||||
{ "<leader>a", group = "lsp action" },
|
||||
{ "<leader>s", group = "snippet" },
|
||||
{ "<leader>e", group = "edit config" },
|
||||
},
|
||||
},
|
||||
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,
|
||||
build = ":TSUpdate"
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||
config = function()
|
||||
require("treesitter-context").setup()
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,31 @@
|
|||
return {
|
||||
{
|
||||
'ibhagwan/fzf-lua',
|
||||
dependencies = { { 'nvim-mini/mini.icons' }, },
|
||||
opts = {
|
||||
"ibhagwan/fzf-lua",
|
||||
dependencies = { { "nvim-mini/mini.icons" } },
|
||||
epts = {
|
||||
winopts = {
|
||||
preview = {
|
||||
vertical = "down:65%",
|
||||
flip_columns = 120
|
||||
}
|
||||
flip_columns = 120,
|
||||
},
|
||||
},
|
||||
files = { git_icons = true, },
|
||||
files = { git_icons = true },
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "f", "<cmd>FzfLua global<CR>", mode = { "n" }, desc = "Fzf everything" },
|
||||
{ "<leader>fg", "<cmd>FzfLua global<CR>", mode = { "n" }, desc = "Fzf everything" },
|
||||
{ '<leader>f"', "<cmd>FzfLua registers<CR>", mode = { "n" }, desc = "fzf registers" },
|
||||
{ "<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 {
|
||||
{
|
||||
'mason-org/mason-lspconfig.nvim',
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
{ 'mason-org/mason.nvim', opts = {} },
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
}
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
{ "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,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue