feat(nvim): clueless.
This commit is contained in:
parent
6456f7b216
commit
e8279efeb6
15 changed files with 1003 additions and 1055 deletions
7
dot_config/nvim/dot_stylua.toml
Normal file
7
dot_config/nvim/dot_stylua.toml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
column_width = 80
|
||||||
|
line_endings = "Unix"
|
||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
quote_style = "AutoPreferDouble"
|
||||||
|
collapse_simple_statement = "Never"
|
||||||
|
call_parentheses = "Always"
|
|
@ -34,6 +34,12 @@ Nmap("<C-J>", "<C-W>j")
|
||||||
Nmap("<C-K>", "<C-W>k")
|
Nmap("<C-K>", "<C-W>k")
|
||||||
Nmap("<C-L>", "<C-W>l")
|
Nmap("<C-L>", "<C-W>l")
|
||||||
Nmap("<C-H>", "<C-W>h")
|
Nmap("<C-H>", "<C-W>h")
|
||||||
|
|
||||||
|
-- merge conflicts
|
||||||
|
Nmap("<leader>gd", ":Gvdiff!<CR>")
|
||||||
|
Nmap("gdh", ":diffget //2<CR>")
|
||||||
|
Nmap("gdl", ":diffget //3<CR>")
|
||||||
|
|
||||||
-- escape :terminal easier
|
-- escape :terminal easier
|
||||||
vim.cmd([[tnoremap <Esc> <C-\><C-n>]])
|
vim.cmd([[tnoremap <Esc> <C-\><C-n>]])
|
||||||
|
|
||||||
|
@ -45,9 +51,9 @@ vim.o.expandtab = true
|
||||||
-- indentation autocmds for some filetypes
|
-- indentation autocmds for some filetypes
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
" smol spaces for soydev
|
" smol spaces for soydev
|
||||||
autocmd FileType html,css,js,jsreact,ts,tsreact,json,yaml setlocal ts=2 sw=2 sts=0 et
|
autocmd FileType html,lua,css,js,jsreact,ts,tsreact,json,yaml setlocal ts=2 sw=2 sts=0 et
|
||||||
" Tabs, yikes
|
" Tabs, yikes
|
||||||
autocmd FileType go,lua setlocal ts=4 sw=4 sts=4 noet
|
autocmd FileType go setlocal ts=4 sw=4 sts=4 noet
|
||||||
" Spaces, based languages
|
" Spaces, based languages
|
||||||
autocmd FileType python,rust setlocal ts=4 sw=4 sts=4 et
|
autocmd FileType python,rust setlocal ts=4 sw=4 sts=4 et
|
||||||
autocmd FileType markdown let g:table_mode_corner='|'
|
autocmd FileType markdown let g:table_mode_corner='|'
|
||||||
|
@ -55,22 +61,32 @@ autocmd FileType markdown let g:table_mode_corner='|'
|
||||||
|
|
||||||
-- auto-compile when lua files in `~/.config/nvim/*` change
|
-- auto-compile when lua files in `~/.config/nvim/*` change
|
||||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
pattern = "*.lua",
|
pattern = "*.lua",
|
||||||
callback = function()
|
callback = function()
|
||||||
local cfg_path = vim.fn.resolve(vim.fn.stdpath("config"))
|
local cfg_path = vim.fn.resolve(vim.fn.stdpath("config"))
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
if vim.fn.expand("%:p"):match(cfg_path) then
|
if vim.fn.expand("%:p"):match(cfg_path) then
|
||||||
vim.cmd("silent! PackerCompile")
|
vim.cmd("silent! PackerCompile")
|
||||||
end
|
end
|
||||||
end, 0)
|
end, 0)
|
||||||
end,
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local wr_group = vim.api.nvim_create_augroup("WinResize", { clear = true })
|
||||||
|
|
||||||
|
-- resize splits when vim window is resized
|
||||||
|
vim.api.nvim_create_autocmd("VimResized", {
|
||||||
|
group = wr_group,
|
||||||
|
pattern = "*",
|
||||||
|
command = "wincmd =",
|
||||||
|
desc = "Automatically resize windows when the host window size changes.",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- neovide settings {{{
|
-- neovide settings {{{
|
||||||
if vim.g.neovide then
|
if vim.g.neovide then
|
||||||
vim.cmd("cd $HOME")
|
vim.cmd("cd $HOME")
|
||||||
vim.g.neovide_cursor_vfx_mode = "ripple"
|
vim.g.neovide_cursor_vfx_mode = "ripple"
|
||||||
vim.g.neovide_input_macos_alt_is_meta = true
|
vim.g.neovide_input_macos_alt_is_meta = true
|
||||||
vim.o.guifont = "VictorMono Nerd Font:h18"
|
vim.o.guifont = "VictorMono Nerd Font:h18"
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
require("bufferline").setup({
|
|
||||||
closable = false,
|
|
||||||
icons = "both",
|
|
||||||
insert_at_end = true,
|
|
||||||
no_name_title = "",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- hop between buffers in order of the bar
|
|
||||||
Nmap("<A-,>", "<Cmd>BufferPrevious<CR>")
|
|
||||||
Nmap("<A-.>", "<Cmd>BufferNext<CR>")
|
|
||||||
-- Re-order to previous/next
|
|
||||||
Nmap("<A-<>", "<Cmd>BufferMovePrevious<CR>")
|
|
||||||
Nmap("<A->>", "<Cmd>BufferMoveNext<CR>")
|
|
||||||
-- Goto buffer in position...
|
|
||||||
Nmap("<A-1>", "<Cmd>BufferGoto 1<CR>")
|
|
||||||
Nmap("<A-2>", "<Cmd>BufferGoto 2<CR>")
|
|
||||||
Nmap("<A-3>", "<Cmd>BufferGoto 3<CR>")
|
|
||||||
Nmap("<A-4>", "<Cmd>BufferGoto 4<CR>")
|
|
||||||
Nmap("<A-5>", "<Cmd>BufferGoto 5<CR>")
|
|
||||||
Nmap("<A-6>", "<Cmd>BufferGoto 6<CR>")
|
|
||||||
Nmap("<A-7>", "<Cmd>BufferGoto 7<CR>")
|
|
||||||
Nmap("<A-8>", "<Cmd>BufferGoto 8<CR>")
|
|
||||||
Nmap("<A-9>", "<Cmd>BufferGoto 9<CR>")
|
|
||||||
Nmap("<A-0>", "<Cmd>BufferLast<CR>")
|
|
||||||
-- Pin/unpin buffer
|
|
||||||
Nmap("<A-p>", "<Cmd>BufferPin<CR>")
|
|
||||||
-- Close buffer
|
|
||||||
Nmap("<A-x>", "<Cmd>BufferClose<CR>")
|
|
||||||
Nmap("<A-X>", "<Cmd>BufferClose!<CR>")
|
|
||||||
-- create new buffer
|
|
||||||
Nmap("<A-c>", "<Cmd>enew<CR>")
|
|
||||||
-- pick buffer
|
|
||||||
Nmap("<A-space>", "<Cmd>BufferPick<CR>")
|
|
||||||
-- Sort automatically by...
|
|
||||||
Nmap("<Space>bb", "<Cmd>BufferOrderByBufferNumber<CR>")
|
|
||||||
Nmap("<Space>bd", "<Cmd>BufferOrderByDirectory<CR>")
|
|
||||||
Nmap("<Space>bl", "<Cmd>BufferOrderByLanguage<CR>")
|
|
||||||
Nmap("<Space>bw", "<Cmd>BufferOrderByWindowNumber<CR>")
|
|
40
dot_config/nvim/lua/config/bufferline.lua
Normal file
40
dot_config/nvim/lua/config/bufferline.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
require("bufferline").setup({
|
||||||
|
options = {
|
||||||
|
show_close_icon = false,
|
||||||
|
separator_style = "slant",
|
||||||
|
close_icon = "",
|
||||||
|
offsets = { { filetype = "NvimTree" } },
|
||||||
|
left_mouse_command = "buffer %d",
|
||||||
|
middle_mouse_command = "bdelete! %d",
|
||||||
|
right_mouse_command = nil,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
-- hop between buffers in order of the bar
|
||||||
|
Nmap("<A-,>", "<Cmd>BufferLineCyclePrev<CR>")
|
||||||
|
Nmap("<A-.>", "<Cmd>BufferLineCycleNext<CR>")
|
||||||
|
-- Re-order to previous/next
|
||||||
|
Nmap("<A-<>", "<Cmd>BufferLineMovePrev<CR>")
|
||||||
|
Nmap("<A->>", "<Cmd>BufferLineMoveNext<CR>")
|
||||||
|
-- Goto buffer in position...
|
||||||
|
Nmap("<A-1>", "<Cmd>BufferLineGoToBuffer 1<CR>")
|
||||||
|
Nmap("<A-2>", "<Cmd>BufferLineGoToBuffer 2<CR>")
|
||||||
|
Nmap("<A-3>", "<Cmd>BufferLineGoToBuffer 3<CR>")
|
||||||
|
Nmap("<A-4>", "<Cmd>BufferLineGoToBuffer 4<CR>")
|
||||||
|
Nmap("<A-5>", "<Cmd>BufferLineGoToBuffer 5<CR>")
|
||||||
|
Nmap("<A-6>", "<Cmd>BufferLineGoToBuffer 6<CR>")
|
||||||
|
Nmap("<A-7>", "<Cmd>BufferLineGoToBuffer 7<CR>")
|
||||||
|
Nmap("<A-8>", "<Cmd>BufferLineGoToBuffer 8<CR>")
|
||||||
|
Nmap("<A-9>", "<Cmd>BufferLineGoToBuffer 9<CR>")
|
||||||
|
Nmap("<A-0>", "<Cmd>BufferLineGoToBuffer -1<CR>")
|
||||||
|
-- Pin/unpin buffer
|
||||||
|
Nmap("<A-p>", "<Cmd>BufferLineTogglePin<CR>")
|
||||||
|
-- Close buffer
|
||||||
|
Nmap("<A-x>", "<Cmd>bdelete<CR>")
|
||||||
|
Nmap("<A-X>", "<Cmd>bdelete!<CR>")
|
||||||
|
-- create new buffer
|
||||||
|
Nmap("<A-c>", "<Cmd>enew<CR>")
|
||||||
|
-- pick buffer
|
||||||
|
Nmap("<A-space>", "<Cmd>BufferLinePick<CR>")
|
||||||
|
-- Sort automatically by...
|
||||||
|
Nmap("<Space>bd", "<Cmd>BufferLineSortByDirectory<CR>")
|
||||||
|
Nmap("<Space>bl", "<Cmd>BufferLineSortByExtension<CR>")
|
|
@ -1,70 +1,83 @@
|
||||||
-- use transparency in terminal only
|
local colors = require("catppuccin.palettes").get_palette()
|
||||||
vim.g.catppuccin_flavour = "mocha"
|
vim.g.catppuccin_flavour = "frappe"
|
||||||
|
|
||||||
require("catppuccin").setup({
|
require("catppuccin").setup({
|
||||||
transparent_background = false,
|
dim_inactive = {
|
||||||
term_colors = true,
|
enable = true,
|
||||||
dim_inactive = {
|
shade = "dark",
|
||||||
enable = false,
|
percentage = 0.15,
|
||||||
shade = "dark",
|
},
|
||||||
percentage = 0.05,
|
styles = {
|
||||||
},
|
comments = { "italic" },
|
||||||
styles = {
|
conditionals = { "italic" },
|
||||||
comments = { "italic" },
|
},
|
||||||
conditionals = { "italic" },
|
integrations = {
|
||||||
},
|
treesitter = true,
|
||||||
integrations = {
|
native_lsp = {
|
||||||
treesitter = true,
|
enabled = true,
|
||||||
native_lsp = {
|
virtual_text = {
|
||||||
enabled = true,
|
errors = { "italic" },
|
||||||
virtual_text = {
|
hints = { "italic" },
|
||||||
errors = { "italic" },
|
warnings = { "italic" },
|
||||||
hints = { "italic" },
|
information = { "italic" },
|
||||||
warnings = { "italic" },
|
},
|
||||||
information = { "italic" },
|
underlines = {
|
||||||
},
|
errors = { "underline" },
|
||||||
underlines = {
|
hints = { "underline" },
|
||||||
errors = { "underline" },
|
warnings = { "underline" },
|
||||||
hints = { "underline" },
|
information = { "underline" },
|
||||||
warnings = { "underline" },
|
},
|
||||||
information = { "underline" },
|
},
|
||||||
},
|
cmp = true,
|
||||||
},
|
coc_nvim = false,
|
||||||
cmp = true,
|
lsp_saga = true,
|
||||||
coc_nvim = false,
|
lsp_trouble = true,
|
||||||
lsp_saga = true,
|
nvimtree = {
|
||||||
lsp_trouble = true,
|
enabled = false,
|
||||||
nvimtree = {
|
},
|
||||||
enabled = false,
|
neotree = {
|
||||||
},
|
enabled = true,
|
||||||
neotree = {
|
show_root = false,
|
||||||
enabled = true,
|
transparent_panel = false,
|
||||||
show_root = false,
|
},
|
||||||
transparent_panel = false,
|
which_key = true,
|
||||||
},
|
indent_blankline = {
|
||||||
which_key = true,
|
enabled = true,
|
||||||
indent_blankline = {
|
colored_indent_levels = true,
|
||||||
enabled = true,
|
},
|
||||||
colored_indent_levels = true,
|
barbar = false,
|
||||||
},
|
bufferline = true,
|
||||||
barbar = false,
|
dashboard = false,
|
||||||
bufferline = true,
|
fern = false,
|
||||||
dashboard = true,
|
gitgutter = false,
|
||||||
fern = false,
|
gitsigns = true,
|
||||||
gitgutter = false,
|
hop = false,
|
||||||
gitsigns = true,
|
leap = false,
|
||||||
hop = false,
|
lightspeed = true,
|
||||||
leap = false,
|
markdown = true,
|
||||||
lightspeed = true,
|
neogit = true,
|
||||||
markdown = true,
|
notify = false,
|
||||||
neogit = true,
|
symbols_outline = true,
|
||||||
notify = false,
|
telekasten = false,
|
||||||
symbols_outline = true,
|
telescope = true,
|
||||||
telekasten = false,
|
ts_rainbow = true,
|
||||||
telescope = true,
|
vim_sneak = false,
|
||||||
ts_rainbow = true,
|
},
|
||||||
vim_sneak = false,
|
custom_highlights = {
|
||||||
}
|
DashboardShortCut = { fg = colors.yellow },
|
||||||
|
DashboardHeader = { fg = colors.red },
|
||||||
|
DashboardCenter = { fg = colors.peach },
|
||||||
|
DashboardFooter = { fg = colors.maroon },
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd("colorscheme catppuccin")
|
vim.api.nvim_command("colorscheme catppuccin")
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
package.loaded["feline"] = nil
|
||||||
|
package.loaded["catppuccin.groups.integrations.feline"] = nil
|
||||||
|
require("config.feline")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
26
dot_config/nvim/lua/config/colorizer.lua
Normal file
26
dot_config/nvim/lua/config/colorizer.lua
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
require("colorizer").setup({
|
||||||
|
user_default_options = {
|
||||||
|
RGB = true, -- #RGB hex codes
|
||||||
|
RRGGBB = true, -- #RRGGBB hex codes
|
||||||
|
names = false, -- "Name" codes like Blue or blue
|
||||||
|
RRGGBBAA = false, -- #RRGGBBAA hex codes
|
||||||
|
AARRGGBB = false, -- 0xAARRGGBB hex codes
|
||||||
|
rgb_fn = false, -- CSS rgb() and rgba() functions
|
||||||
|
hsl_fn = false, -- CSS hsl() and hsla() functions
|
||||||
|
css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||||
|
css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||||
|
-- Available modes for `mode`: foreground, background, virtualtext
|
||||||
|
mode = "background", -- Set the display mode.
|
||||||
|
-- Available methods are false / true / "normal" / "lsp" / "both"
|
||||||
|
-- True is same as normal
|
||||||
|
tailwind = true,
|
||||||
|
-- parsers can contain values used in |user_default_options|
|
||||||
|
sass = { enable = true }, -- Enable sass colors
|
||||||
|
},
|
||||||
|
buftypes = {
|
||||||
|
"*",
|
||||||
|
-- exclude prompt and popup buftypes from highlight
|
||||||
|
"!prompt",
|
||||||
|
"!popup",
|
||||||
|
},
|
||||||
|
})
|
|
@ -1,66 +1,78 @@
|
||||||
|
local cp = require("catppuccin.palettes.init").get_palette()
|
||||||
|
|
||||||
local home = os.getenv("HOME")
|
local home = os.getenv("HOME")
|
||||||
local db = require("dashboard")
|
local db = require("dashboard")
|
||||||
|
|
||||||
db.custom_header = function()
|
db.custom_header = function()
|
||||||
local quotes = {
|
local quotes = {
|
||||||
"Demonic presence at unsafe levels.",
|
"Demonic presence at unsafe levels.",
|
||||||
"Rip and tear, until it is done.",
|
"Rip and tear, until it is done.",
|
||||||
"So you walk eternally through the shadow realms.",
|
"So you walk eternally through the shadow realms.",
|
||||||
"The only thing they fear... is you.",
|
"The only thing they fear... is you.",
|
||||||
"There he lies still, and ever more, in silent suffering.",
|
"There he lies still, and ever more, in silent suffering.",
|
||||||
"We will send unto them...only you.",
|
"We will send unto them...only you.",
|
||||||
"What you see now in this facility is the cost. Of progress.",
|
"What you see now in this facility is the cost. Of progress.",
|
||||||
"You can't just shoot a hole in the surface of mars!",
|
"You can't just shoot a hole in the surface of mars!",
|
||||||
"WARNING: The Slayer has entered the facility.",
|
"WARNING: The Slayer has entered the facility.",
|
||||||
"DANGER: THE SLAYER HAS CONTROL OF THE BFG.",
|
"DANGER: THE SLAYER HAS CONTROL OF THE BFG.",
|
||||||
}
|
}
|
||||||
local random_quote = quotes[math.random(#quotes)]
|
local random_quote = quotes[math.random(#quotes)]
|
||||||
return {
|
return {
|
||||||
[[]],
|
[[]],
|
||||||
[[ _ _ _____ _ _ _____ _____ _____ _ _ _ _ ________ ___]],
|
[[ _ _ _____ _ _ _____ _____ _____ _ _ _ _ ________ ___]],
|
||||||
[[| | | |_ _| \ | |/ ___|_ _| _ | \ | | | | | |_ _| \/ |]],
|
[[| | | |_ _| \ | |/ ___|_ _| _ | \ | | | | | |_ _| \/ |]],
|
||||||
[[| | | | | | | \| |\ `--. | | | | | | \| | | | | | | | | . . |]],
|
[[| | | | | | | \| |\ `--. | | | | | | \| | | | | | | | | . . |]],
|
||||||
[[| |/\| | | | | . ` | `--. \ | | | | | | . ` | | | | | | | | |\/| |]],
|
[[| |/\| | | | | . ` | `--. \ | | | | | | . ` | | | | | | | | |\/| |]],
|
||||||
[[\ /\ /_| |_| |\ |/\__/ / | | \ \_/ / |\ | _ \ \_/ /_| |_| | | |]],
|
[[\ /\ /_| |_| |\ |/\__/ / | | \ \_/ / |\ | _ \ \_/ /_| |_| | | |]],
|
||||||
[[ \/ \/ \___/\_| \_/\____/ \_/ \___/\_| \_/ (_) \___/ \___/\_| |_/]],
|
[[ \/ \/ \___/\_| \_/\____/ \_/ \___/\_| \_/ (_) \___/ \___/\_| |_/]],
|
||||||
[[]],
|
[[]],
|
||||||
random_quote,
|
random_quote,
|
||||||
[[]],
|
[[]],
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
db.custom_center = {
|
db.custom_center = {
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Restore latest session ",
|
desc = "Restore latest session ",
|
||||||
action = "SessionLoad",
|
action = "SessionLoad",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Open Projects ",
|
desc = "Open Projects ",
|
||||||
action = "Telescope project",
|
action = "Telescope project",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Find File ",
|
desc = "Find File ",
|
||||||
action = "Telescope find_files find_command=rg,--hidden,--files",
|
action = "Telescope find_files find_command=rg,--hidden,--files",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "File Browser ",
|
desc = "File Browser ",
|
||||||
action = "Telescope file_browser",
|
action = "Telescope file_browser",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Find word ",
|
desc = "Find word ",
|
||||||
action = "Telescope live_grep",
|
action = "Telescope live_grep",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Open Settings ",
|
desc = "Open Settings ",
|
||||||
action = function()
|
action = function()
|
||||||
vim.cmd("cd " .. home .. "/.config/nvim/")
|
vim.cmd("cd " .. home .. "/.config/nvim/")
|
||||||
vim.cmd("edit init.lua")
|
vim.cmd("edit init.lua")
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db.custom_footer = function()
|
||||||
|
local v = vim.version()
|
||||||
|
local vStr = string.format("%d.%d.%d", v.major, v.minor, v.patch)
|
||||||
|
local plugCount = #vim.tbl_keys(packer_plugins)
|
||||||
|
return {
|
||||||
|
"neovim " .. vStr,
|
||||||
|
plugCount .. " regrets",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
|
@ -2,57 +2,41 @@ local clrs = require("catppuccin.palettes.init").get_palette()
|
||||||
local ctp_feline = require("catppuccin.groups.integrations.feline")
|
local ctp_feline = require("catppuccin.groups.integrations.feline")
|
||||||
|
|
||||||
ctp_feline.setup({
|
ctp_feline.setup({
|
||||||
assets = {
|
assets = {
|
||||||
left_separator = "",
|
left_separator = "",
|
||||||
right_separator = "",
|
right_separator = "",
|
||||||
bar = "█",
|
bar = "█",
|
||||||
mode_icon = " ",
|
mode_icon = " ",
|
||||||
},
|
dir = " ",
|
||||||
sett = {
|
file = " ",
|
||||||
show_modified = true,
|
git = {
|
||||||
curr_dir = clrs.mauve,
|
branch = " ",
|
||||||
curr_file = clrs.blue,
|
},
|
||||||
},
|
},
|
||||||
|
sett = {
|
||||||
|
show_modified = true,
|
||||||
|
curr_dir = clrs.mauve,
|
||||||
|
curr_file = clrs.blue,
|
||||||
|
},
|
||||||
|
mode_colors = {
|
||||||
|
["n"] = { "NORMAL", clrs.blue },
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
require("feline").setup({
|
require("feline").setup({
|
||||||
components = ctp_feline.get(),
|
components = ctp_feline.get(),
|
||||||
force_inactive = {
|
force_inactive = {
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"^packer$",
|
"^packer$",
|
||||||
"^startify$",
|
"^startify$",
|
||||||
"^fugitive$",
|
"^fugitive$",
|
||||||
"^fugitiveblame$",
|
"^fugitiveblame$",
|
||||||
"^qf$",
|
"^qf$",
|
||||||
"^help$",
|
"^help$",
|
||||||
},
|
},
|
||||||
buftypes = {
|
buftypes = {
|
||||||
"^terminal$",
|
"^terminal$",
|
||||||
},
|
},
|
||||||
bufnames = {},
|
bufnames = {},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- local navic = require("nvim-navic")
|
|
||||||
|
|
||||||
-- local wbar = {
|
|
||||||
-- active = {},
|
|
||||||
-- inactive = {}
|
|
||||||
-- }
|
|
||||||
-- table.insert(wbar.active, {})
|
|
||||||
-- table.insert(wbar.active, {})
|
|
||||||
-- table.insert(wbar.active, {})
|
|
||||||
|
|
||||||
-- table.insert(wbar.active[1], {
|
|
||||||
-- provider = function()
|
|
||||||
-- return navic.get_location()
|
|
||||||
-- end,
|
|
||||||
-- enabled = function()
|
|
||||||
-- return navic.is_available()
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
-- table.insert(wbar.active[3], {
|
|
||||||
-- provider = 'lsp_client_names'
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- require("feline").winbar.setup({ components = wbar })
|
|
||||||
|
|
|
@ -1,63 +1,63 @@
|
||||||
require("gitsigns").setup({
|
require("gitsigns").setup({
|
||||||
signs = {
|
signs = {
|
||||||
add = {
|
add = {
|
||||||
hl = "GitSignsAdd",
|
hl = "GitSignsAdd",
|
||||||
text = "+",
|
text = "+",
|
||||||
numhl = "GitSignsAddNr",
|
numhl = "GitSignsAddNr",
|
||||||
linehl = "GitSignsAddLn",
|
linehl = "GitSignsAddLn",
|
||||||
},
|
},
|
||||||
change = {
|
change = {
|
||||||
hl = "GitSignsChange",
|
hl = "GitSignsChange",
|
||||||
text = "~",
|
text = "~",
|
||||||
numhl = "GitSignsChangeNr",
|
numhl = "GitSignsChangeNr",
|
||||||
linehl = "GitSignsChangeLn",
|
linehl = "GitSignsChangeLn",
|
||||||
},
|
},
|
||||||
delete = {
|
delete = {
|
||||||
hl = "GitSignsDelete",
|
hl = "GitSignsDelete",
|
||||||
text = "_",
|
text = "_",
|
||||||
numhl = "GitSignsDeleteNr",
|
numhl = "GitSignsDeleteNr",
|
||||||
linehl = "GitSignsDeleteLn",
|
linehl = "GitSignsDeleteLn",
|
||||||
},
|
},
|
||||||
topdelete = {
|
topdelete = {
|
||||||
hl = "GitSignsDelete",
|
hl = "GitSignsDelete",
|
||||||
text = "‾",
|
text = "‾",
|
||||||
numhl = "GitSignsDeleteNr",
|
numhl = "GitSignsDeleteNr",
|
||||||
linehl = "GitSignsDeleteLn",
|
linehl = "GitSignsDeleteLn",
|
||||||
},
|
},
|
||||||
changedelete = {
|
changedelete = {
|
||||||
hl = "GitSignsChange",
|
hl = "GitSignsChange",
|
||||||
text = "x",
|
text = "x",
|
||||||
numhl = "GitSignsChangeNr",
|
numhl = "GitSignsChangeNr",
|
||||||
linehl = "GitSignsChangeLn",
|
linehl = "GitSignsChangeLn",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
linehl = false,
|
linehl = false,
|
||||||
numhl = false,
|
numhl = false,
|
||||||
signcolumn = true,
|
signcolumn = true,
|
||||||
word_diff = false,
|
word_diff = false,
|
||||||
watch_gitdir = { interval = 1000, follow_files = true },
|
watch_gitdir = { interval = 1000, follow_files = true },
|
||||||
attach_to_untracked = true,
|
attach_to_untracked = true,
|
||||||
-- current line highlighting
|
-- current line highlighting
|
||||||
current_line_blame = true,
|
current_line_blame = true,
|
||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
delay = 1000,
|
delay = 1000,
|
||||||
ignore_whitespace = true,
|
ignore_whitespace = true,
|
||||||
virt_text = true,
|
virt_text = true,
|
||||||
virt_text_pos = "eol",
|
virt_text_pos = "eol",
|
||||||
},
|
},
|
||||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary> | <abbrev_sha>",
|
current_line_blame_formatter = "<author>, <author_time:%R> - <summary> | <abbrev_sha>",
|
||||||
-- perf
|
-- perf
|
||||||
max_file_length = 40000,
|
max_file_length = 40000,
|
||||||
sign_priority = 6,
|
sign_priority = 6,
|
||||||
update_debounce = 100,
|
update_debounce = 100,
|
||||||
-- use the included status formatter
|
-- use the included status formatter
|
||||||
status_formatter = nil,
|
status_formatter = nil,
|
||||||
preview_config = {
|
preview_config = {
|
||||||
border = "single",
|
border = "single",
|
||||||
style = "minimal",
|
style = "minimal",
|
||||||
relative = "cursor",
|
relative = "cursor",
|
||||||
row = 0,
|
row = 0,
|
||||||
col = 1,
|
col = 1,
|
||||||
},
|
},
|
||||||
yadm = { enable = false },
|
yadm = { enable = false },
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
local saga = require("lspsaga")
|
local saga = require("lspsaga")
|
||||||
saga.init_lsp_saga()
|
saga.init_lsp_saga({
|
||||||
|
code_action_lightbulb = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
Nmap("gr", "<cmd>Lspsaga rename<cr>")
|
Nmap("gr", "<cmd>Lspsaga rename<cr>")
|
||||||
Nmap("gx", "<cmd>Lspsaga code_action<cr>")
|
Nmap("gx", "<cmd>Lspsaga code_action<cr>")
|
||||||
|
@ -8,16 +12,6 @@ Nmap("K", "<cmd>Lspsaga hover_doc<cr>")
|
||||||
Nmap("go", "<cmd>Lspsaga show_line_diagnostics<cr>")
|
Nmap("go", "<cmd>Lspsaga show_line_diagnostics<cr>")
|
||||||
Nmap("gj", "<cmd>Lspsaga diagnostic_jump_next<cr>")
|
Nmap("gj", "<cmd>Lspsaga diagnostic_jump_next<cr>")
|
||||||
Nmap("gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>")
|
Nmap("gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>")
|
||||||
-- Nmap("<C-u>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1, '<c-u>')<cr>", {})
|
|
||||||
-- Nmap("<C-d>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1, '<c-d>')<cr>", {})
|
|
||||||
|
|
||||||
-- vim.keymap.set("n", "<C-u>", function()
|
|
||||||
-- require("lspsaga.action").smart_scroll_with_saga(1)
|
|
||||||
-- end)
|
|
||||||
-- -- scroll up
|
|
||||||
-- vim.keymap.set("n", "<C-d>", function()
|
|
||||||
-- require("lspsaga.action").smart_scroll_with_saga(-1)
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
nnoremap <silent> <A-d> <cmd>lua require('lspsaga.floaterm').open_float_terminal()<CR>
|
nnoremap <silent> <A-d> <cmd>lua require('lspsaga.floaterm').open_float_terminal()<CR>
|
||||||
|
|
|
@ -1,110 +1,109 @@
|
||||||
function string.starts(self, str)
|
function string.starts(self, str)
|
||||||
return self:find('^' .. str) ~= nil
|
return self:find("^" .. str) ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local conceal = function()
|
local conceal = function()
|
||||||
local home = os.getenv("HOME")
|
local home = os.getenv("HOME")
|
||||||
local blacklist = {
|
local blacklist = {
|
||||||
[home .. "/git/work"] = "Working...",
|
[home .. "/git/work"] = "Using nvim at work.",
|
||||||
[home .. "/git/freelance"] = "Freelancing...",
|
[home .. "/git/freelance"] = "Using nvim to freelance.",
|
||||||
[home .. "/git/freelance"] = "Freelancing...",
|
}
|
||||||
}
|
|
||||||
|
|
||||||
local cur_file = vim.fn.expand("%:p")
|
local cur_file = vim.fn.expand("%:p")
|
||||||
for k, v in pairs(blacklist) do
|
for k, v in pairs(blacklist) do
|
||||||
if cur_file:starts(k) then
|
if cur_file:starts(k) then
|
||||||
return v
|
return v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
require("presence"):setup({
|
require("presence"):setup({
|
||||||
-- General options
|
-- General options
|
||||||
auto_update = true,
|
auto_update = true,
|
||||||
neovim_image_text = "The Soydev's Kryptonite",
|
neovim_image_text = "The Soydev's Kryptonite",
|
||||||
-- Main image display (either "neovim" or "file")
|
-- Main image display (either "neovim" or "file")
|
||||||
main_image = "file",
|
main_image = "file",
|
||||||
-- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
-- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
||||||
---@diagnostic disable-next-line: unused-local
|
---@diagnostic disable-next-line: unused-local
|
||||||
buttons = function(buffer, repo_url)
|
buttons = function(buffer, repo_url)
|
||||||
-- ignore where no repo_url is set
|
-- ignore where no repo_url is set
|
||||||
if repo_url == nil then
|
if repo_url == nil then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- only show certain org/user repos, don't leak clients or work
|
-- only show certain org/user repos, don't leak clients or work
|
||||||
local visible_urls = {
|
local visible_urls = {
|
||||||
"github.com/catppuccin",
|
"github.com/catppuccin",
|
||||||
"github.com/farbenfroh",
|
"github.com/farbenfroh",
|
||||||
"github.com/nekowinston",
|
"github.com/nekowinston",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- check if repo_url is in the list of visible urls
|
-- check if repo_url is in the list of visible urls
|
||||||
for _, visible_url in ipairs(visible_urls) do
|
for _, visible_url in ipairs(visible_urls) do
|
||||||
if repo_url:find(visible_url) then
|
if repo_url:find(visible_url) then
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
label = "Steal the code",
|
label = "Steal the code",
|
||||||
url = repo_url,
|
url = repo_url,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if not, return false
|
-- if not, return false
|
||||||
return false
|
return false
|
||||||
end,
|
end,
|
||||||
debounce_timeout = 10,
|
debounce_timeout = 10,
|
||||||
file_assets = {
|
file_assets = {
|
||||||
["k8s.yaml"] = {
|
["k8s.yaml"] = {
|
||||||
"Kubernetes",
|
"Kubernetes",
|
||||||
"https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png",
|
"https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png",
|
||||||
},
|
},
|
||||||
["Chart.yaml"] = {
|
["Chart.yaml"] = {
|
||||||
"Helm Chart",
|
"Helm Chart",
|
||||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||||
},
|
},
|
||||||
["helmfile.yaml"] = {
|
["helmfile.yaml"] = {
|
||||||
"helmfile",
|
"helmfile",
|
||||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||||
},
|
},
|
||||||
["prisma"] = {
|
["prisma"] = {
|
||||||
"Prisma",
|
"Prisma",
|
||||||
"https://avatars.githubusercontent.com/u/17219288"
|
"https://avatars.githubusercontent.com/u/17219288",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
-- Rich Presence text options
|
-- Rich Presence text options
|
||||||
editing_text = function(s)
|
editing_text = function(s)
|
||||||
local concealed = conceal()
|
local concealed = conceal()
|
||||||
if concealed then
|
if concealed then
|
||||||
return concealed
|
return concealed
|
||||||
end
|
end
|
||||||
return "✍️ " .. s
|
return "Editing " .. s
|
||||||
end,
|
end,
|
||||||
reading_text = function(s)
|
reading_text = function(s)
|
||||||
local concealed = conceal()
|
local concealed = conceal()
|
||||||
if concealed then
|
if concealed then
|
||||||
return concealed
|
return concealed
|
||||||
end
|
end
|
||||||
return "📖 " .. s
|
return "Reading " .. s
|
||||||
end,
|
end,
|
||||||
file_explorer_text = function(s)
|
file_explorer_text = function(s)
|
||||||
local concealed = conceal()
|
local concealed = conceal()
|
||||||
if concealed then
|
if concealed then
|
||||||
return concealed
|
return concealed
|
||||||
end
|
end
|
||||||
return "📁 " .. s
|
return "Working in " .. s
|
||||||
end,
|
end,
|
||||||
workspace_text = function(s)
|
workspace_text = function(s)
|
||||||
local concealed = conceal()
|
local concealed = conceal()
|
||||||
if s ~= nil and not concealed then
|
if s ~= nil and not concealed then
|
||||||
return "🗂️ ".. s
|
return "Working on " .. s
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
git_commit_text = "Committing changes",
|
git_commit_text = "Committing changes",
|
||||||
plugin_manager_text = "🤹 Managing Plugins",
|
plugin_manager_text = "Managing Plugins",
|
||||||
line_number_text = "L%s of %s",
|
line_number_text = "L%s of %s",
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,65 +1,45 @@
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
ignore_install = {
|
ignore_install = {
|
||||||
-- woulnd't install sometimes, not needed
|
-- woulnd't install sometimes, not needed
|
||||||
"phpdoc",
|
"phpdoc",
|
||||||
},
|
},
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
"bash",
|
||||||
"c",
|
"css",
|
||||||
"cmake",
|
"dockerfile",
|
||||||
"comment",
|
"go",
|
||||||
"cpp",
|
"gomod",
|
||||||
"css",
|
"graphql",
|
||||||
"dockerfile",
|
"help",
|
||||||
"fish",
|
"hjson",
|
||||||
"gdscript",
|
"html",
|
||||||
"glsl",
|
"http",
|
||||||
"go",
|
"javascript",
|
||||||
"godot_resource",
|
"jsdoc",
|
||||||
"gomod",
|
"json",
|
||||||
"gowork",
|
"json5",
|
||||||
"graphql",
|
"jsonc",
|
||||||
"help",
|
"latex",
|
||||||
"hjson",
|
"lua",
|
||||||
"html",
|
"make",
|
||||||
"http",
|
"markdown",
|
||||||
"java",
|
"php",
|
||||||
"javascript",
|
"prisma",
|
||||||
"jsdoc",
|
"python",
|
||||||
"json",
|
"regex",
|
||||||
"json5",
|
"rust",
|
||||||
"jsonc",
|
"scss",
|
||||||
"kotlin",
|
"sql",
|
||||||
"latex",
|
"svelte",
|
||||||
"lua",
|
"teal",
|
||||||
"make",
|
"toml",
|
||||||
"markdown",
|
"tsx",
|
||||||
"ninja",
|
"typescript",
|
||||||
"perl",
|
"vim",
|
||||||
"php",
|
"yaml",
|
||||||
"prisma",
|
},
|
||||||
"proto",
|
|
||||||
"pug",
|
|
||||||
"python",
|
|
||||||
"rasi",
|
|
||||||
"regex",
|
|
||||||
"ruby",
|
|
||||||
"rust",
|
|
||||||
"scss",
|
|
||||||
"sql",
|
|
||||||
"svelte",
|
|
||||||
"swift",
|
|
||||||
"teal",
|
|
||||||
"todotxt",
|
|
||||||
"toml",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"vim",
|
|
||||||
"vue",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
require("mason").setup({
|
require("mason").setup({
|
||||||
ui = {
|
ui = {
|
||||||
border = "none",
|
border = "none",
|
||||||
icons = {
|
icons = {
|
||||||
package_installed = " ",
|
package_installed = " ",
|
||||||
package_pending = " ",
|
package_pending = " ",
|
||||||
package_uninstalled = " ",
|
package_uninstalled = " ",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
require("mason-lspconfig").setup({ automatic_installation = true })
|
require("mason-lspconfig").setup({ automatic_installation = true })
|
||||||
|
|
||||||
|
@ -18,51 +18,53 @@ vim.opt.completeopt = "menu,menuone,noselect"
|
||||||
-- Setup nvim-cmp.
|
-- Setup nvim-cmp.
|
||||||
local present, cmp = pcall(require, "cmp")
|
local present, cmp = pcall(require, "cmp")
|
||||||
if not present then
|
if not present then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
vim.fn["vsnip#anonymous"](args.body)
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<Tab>"] = cmp.mapping.confirm({ select = true }),
|
["<Tab>"] = cmp.mapping.confirm({ select = true }),
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "vsnip" },
|
{ name = "vsnip" },
|
||||||
}, { { name = "buffer" } }),
|
}, { { name = "buffer" } }),
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Set configuration for specific filetype.
|
-- Set configuration for specific filetype.
|
||||||
cmp.setup.filetype("gitcommit", {
|
cmp.setup.filetype("gitcommit", {
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "cmp_git" },
|
{ name = "cmp_git" },
|
||||||
}, { { name = "buffer" } }),
|
}, { { name = "buffer" } }),
|
||||||
})
|
})
|
||||||
-- search
|
-- search
|
||||||
cmp.setup.cmdline("/", {
|
cmp.setup.cmdline("/", {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = { { name = "buffer" } },
|
sources = { { name = "buffer" } },
|
||||||
})
|
})
|
||||||
-- Use cmdline & path source for ':'
|
-- Use cmdline & path source for ':'
|
||||||
cmp.setup.cmdline(":", {
|
cmp.setup.cmdline(":", {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources(
|
sources = cmp.config.sources(
|
||||||
{ {
|
{ {
|
||||||
name = "path",
|
name = "path",
|
||||||
option = { trailing_slash = true },
|
option = { trailing_slash = true },
|
||||||
} },
|
} },
|
||||||
{ { name = "cmdline" } }
|
{ { name = "cmdline" } }
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Setup lspconfig.
|
-- Setup lspconfig.
|
||||||
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require("cmp_nvim_lsp").update_capabilities(
|
||||||
|
vim.lsp.protocol.make_client_capabilities()
|
||||||
|
)
|
||||||
|
|
||||||
-- Mappings.
|
-- Mappings.
|
||||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
|
@ -76,66 +78,65 @@ vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, opts)
|
||||||
-- after the language server attaches to the current buffer
|
-- after the language server attaches to the current buffer
|
||||||
---@diagnostic disable-next-line: unused-local
|
---@diagnostic disable-next-line: unused-local
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
|
||||||
-- disable diagnostics on Helm files
|
-- disable diagnostics on Helm files
|
||||||
if vim.bo[bufnr].buftype ~= "" or vim.bo[bufnr].filetype == "helm" then
|
if vim.bo[bufnr].buftype ~= "" or vim.bo[bufnr].filetype == "helm" then
|
||||||
vim.diagnostic.disable()
|
vim.diagnostic.disable()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Mappings.
|
-- Mappings.
|
||||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
|
||||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
|
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
|
||||||
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, bufopts)
|
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, bufopts)
|
||||||
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||||
vim.keymap.set("n", "<space>wl", function()
|
vim.keymap.set("n", "<space>wl", function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, bufopts)
|
end, bufopts)
|
||||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
||||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
|
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
|
||||||
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
|
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
|
||||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
||||||
vim.keymap.set("n", "<space>nf", function()
|
vim.keymap.set("n", "<space>nf", function() end, bufopts)
|
||||||
end, bufopts)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local common_config = {
|
local common_config = {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
local present, lsp = pcall(require, "lspconfig")
|
local present, lsp = pcall(require, "lspconfig")
|
||||||
if not present then
|
if not present then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
lsp.sumneko_lua.setup({
|
lsp.sumneko_lua.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
workspace = {
|
workspace = {
|
||||||
-- Make the server aware of Neovim runtime files
|
-- Make the server aware of Neovim runtime files
|
||||||
library = vim.api.nvim_get_runtime_file("", true),
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
checkThirdParty = false,
|
checkThirdParty = false,
|
||||||
maxPreload = 100000,
|
maxPreload = 100000,
|
||||||
preloadFileSize = 10000,
|
preloadFileSize = 10000,
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
-- Get the language server to recognize the `vim` global
|
-- Get the language server to recognize the `vim` global
|
||||||
globals = { "vim" },
|
globals = { "vim" },
|
||||||
},
|
},
|
||||||
telemetry = {
|
telemetry = {
|
||||||
enable = false,
|
enable = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
--- the cool kids
|
--- the cool kids
|
||||||
|
@ -146,29 +147,31 @@ lsp.rust_analyzer.setup(common_config)
|
||||||
|
|
||||||
--- Web Development
|
--- Web Development
|
||||||
lsp.cssls.setup(common_config)
|
lsp.cssls.setup(common_config)
|
||||||
local emmet_cap = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local emmet_cap = require("cmp_nvim_lsp").update_capabilities(
|
||||||
|
vim.lsp.protocol.make_client_capabilities()
|
||||||
|
)
|
||||||
emmet_cap.textDocument.completion.completionItem.snippetSupport = true
|
emmet_cap.textDocument.completion.completionItem.snippetSupport = true
|
||||||
lsp.emmet_ls.setup({
|
lsp.emmet_ls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = emmet_cap,
|
capabilities = emmet_cap,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"javascriptreact",
|
"javascriptreact",
|
||||||
"typescriptreact",
|
"typescriptreact",
|
||||||
"html",
|
"html",
|
||||||
"svelte",
|
"svelte",
|
||||||
"css",
|
"css",
|
||||||
"less",
|
"less",
|
||||||
"sass",
|
"sass",
|
||||||
"scss",
|
"scss",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- lsp.html.setup(common_config)
|
-- lsp.html.setup(common_config)
|
||||||
lsp.tailwindcss.setup({
|
lsp.tailwindcss.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
emmetCompletions = true,
|
emmetCompletions = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- soydev
|
-- soydev
|
||||||
|
@ -176,59 +179,52 @@ lsp.prismals.setup(common_config)
|
||||||
lsp.svelte.setup(common_config)
|
lsp.svelte.setup(common_config)
|
||||||
-- attach tsserver only when there's a 'package.json' file in the CWD
|
-- attach tsserver only when there's a 'package.json' file in the CWD
|
||||||
lsp.tsserver.setup({
|
lsp.tsserver.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = lsp.util.root_pattern("package.json"),
|
root_dir = lsp.util.root_pattern("package.json"),
|
||||||
})
|
})
|
||||||
-- attach deno only when there's a 'deps.ts' file in the CWD
|
-- attach deno only when there's a 'deps.ts' file in the CWD
|
||||||
lsp.denols.setup({
|
lsp.denols.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = lsp.util.root_pattern("deps.ts"),
|
root_dir = lsp.util.root_pattern("deps.ts"),
|
||||||
single_file_support = false,
|
single_file_support = false,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- data formats
|
-- data formats
|
||||||
lsp.dockerls.setup(common_config)
|
lsp.dockerls.setup(common_config)
|
||||||
lsp.graphql.setup({
|
lsp.graphql.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = lsp.util.root_pattern(".graphqlrc*", ".graphql.config.*", "graphql.config.*"),
|
root_dir = lsp.util.root_pattern(
|
||||||
settings = {
|
".graphqlrc*",
|
||||||
graphql = {
|
".graphql.config.*",
|
||||||
schemaPath = "schema.graphql",
|
"graphql.config.*"
|
||||||
},
|
),
|
||||||
},
|
settings = {
|
||||||
|
graphql = {
|
||||||
|
schemaPath = "schema.graphql",
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
lsp.jsonls.setup({
|
lsp.jsonls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
json = {
|
json = {
|
||||||
schemas = require("schemastore").json.schemas(),
|
schemas = require("schemastore").json.schemas(),
|
||||||
validate = { enable = true },
|
validate = { enable = true },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
lsp.yamlls.setup({
|
lsp.yamlls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
redhat = {
|
yaml = {
|
||||||
telemetry = {
|
["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml",
|
||||||
enabled = false,
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
yaml = {
|
|
||||||
schemas = {
|
|
||||||
["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.24.2-standalone-strict/all.json"] = {
|
|
||||||
"*.k8s.yaml",
|
|
||||||
"*.k8s.yml",
|
|
||||||
"kubectl-edit-*.yaml",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
--- Documentation
|
--- Documentation
|
||||||
|
|
|
@ -2,473 +2,392 @@ require("utils")
|
||||||
|
|
||||||
vim.cmd([[packadd packer.nvim]])
|
vim.cmd([[packadd packer.nvim]])
|
||||||
local packer = require("packer")
|
local packer = require("packer")
|
||||||
|
if not packer then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- slow internet...
|
-- slow internet...
|
||||||
packer.init({
|
packer.init({
|
||||||
git = { clone_timeout = 180 },
|
git = { clone_timeout = 180 },
|
||||||
profile = {
|
profile = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
return packer.startup(function(use)
|
return packer.startup(function(use)
|
||||||
-- Packer managing itself
|
-- Packer managing itself
|
||||||
use("wbthomason/packer.nvim")
|
use("wbthomason/packer.nvim")
|
||||||
-- startup time or some shit
|
-- startup time or some shit
|
||||||
use("lewis6991/impatient.nvim")
|
use("lewis6991/impatient.nvim")
|
||||||
|
|
||||||
-- colour scheme
|
-- colour scheme
|
||||||
use({
|
use({
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
as = "catppuccin",
|
as = "catppuccin",
|
||||||
config = function()
|
run = ":CatppuccinCompile",
|
||||||
require("config/catppuccin")
|
config = function()
|
||||||
end,
|
require("config/catppuccin")
|
||||||
})
|
end,
|
||||||
use({
|
})
|
||||||
"Pocco81/true-zen.nvim",
|
|
||||||
config = function()
|
|
||||||
require("true-zen").setup({
|
|
||||||
modes = {
|
|
||||||
ataraxis = {
|
|
||||||
shade = "dark",
|
|
||||||
backdrop = 0.00,
|
|
||||||
quit_untoggles = true,
|
|
||||||
padding = {
|
|
||||||
left = 52,
|
|
||||||
right = 52,
|
|
||||||
top = 0,
|
|
||||||
bottom = 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
narrow = {
|
|
||||||
run_ataraxis = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
integrations = {
|
|
||||||
tmux = true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- git gutter
|
-- git gutter
|
||||||
use({
|
use({
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("config/gitsigns")
|
require("config/gitsigns")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- rainbow indents
|
-- rainbow indents
|
||||||
use({
|
use({
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("indent_blankline").setup({
|
require("indent_blankline").setup({
|
||||||
space_char_blankline = " ",
|
space_char_blankline = " ",
|
||||||
show_current_conext = true,
|
show_current_conext = true,
|
||||||
char_highlight_list = {
|
char_highlight_list = {
|
||||||
"IndentBlanklineIndent1",
|
"IndentBlanklineIndent1",
|
||||||
"IndentBlanklineIndent2",
|
"IndentBlanklineIndent2",
|
||||||
"IndentBlanklineIndent3",
|
"IndentBlanklineIndent3",
|
||||||
"IndentBlanklineIndent4",
|
"IndentBlanklineIndent4",
|
||||||
"IndentBlanklineIndent5",
|
"IndentBlanklineIndent5",
|
||||||
"IndentBlanklineIndent6",
|
"IndentBlanklineIndent6",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
vim.g.indent_blankline_filetype_exclude = {
|
vim.g.indent_blankline_filetype_exclude = {
|
||||||
"dashboard",
|
"dashboard",
|
||||||
"help",
|
"help",
|
||||||
"neogitstatus",
|
"neogitstatus",
|
||||||
"fugitive",
|
"fugitive",
|
||||||
"packer",
|
"packer",
|
||||||
"NvimTree",
|
"NvimTree",
|
||||||
"Trouble",
|
"Trouble",
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- top bar
|
-- top bar
|
||||||
use({
|
use({
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("bufferline").setup({
|
require("config/bufferline")
|
||||||
options = {
|
end,
|
||||||
show_close_icon = false,
|
})
|
||||||
separator_style = "slant",
|
|
||||||
close_icon = "",
|
|
||||||
offsets = { { filetype = "NvimTree" } },
|
|
||||||
left_mouse_command = "buffer %d",
|
|
||||||
middle_mouse_command = "bdelete! %d",
|
|
||||||
right_mouse_command = nil,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
-- hop between buffers in order of the bar
|
|
||||||
Nmap("<A-,>", "<Cmd>BufferLineCyclePrev<CR>")
|
|
||||||
Nmap("<A-.>", "<Cmd>BufferLineCycleNext<CR>")
|
|
||||||
-- Re-order to previous/next
|
|
||||||
Nmap("<A-<>", "<Cmd>BufferLineMovePrev<CR>")
|
|
||||||
Nmap("<A->>", "<Cmd>BufferLineMoveNext<CR>")
|
|
||||||
-- Goto buffer in position...
|
|
||||||
Nmap("<A-1>", "<Cmd>BufferLineGoToBuffer 1<CR>")
|
|
||||||
Nmap("<A-2>", "<Cmd>BufferLineGoToBuffer 2<CR>")
|
|
||||||
Nmap("<A-3>", "<Cmd>BufferLineGoToBuffer 3<CR>")
|
|
||||||
Nmap("<A-4>", "<Cmd>BufferLineGoToBuffer 4<CR>")
|
|
||||||
Nmap("<A-5>", "<Cmd>BufferLineGoToBuffer 5<CR>")
|
|
||||||
Nmap("<A-6>", "<Cmd>BufferLineGoToBuffer 6<CR>")
|
|
||||||
Nmap("<A-7>", "<Cmd>BufferLineGoToBuffer 7<CR>")
|
|
||||||
Nmap("<A-8>", "<Cmd>BufferLineGoToBuffer 8<CR>")
|
|
||||||
Nmap("<A-9>", "<Cmd>BufferLineGoToBuffer 9<CR>")
|
|
||||||
Nmap("<A-0>", "<Cmd>BufferLineGoToBuffer -1<CR>")
|
|
||||||
-- Pin/unpin buffer
|
|
||||||
Nmap("<A-p>", "<Cmd>BufferLineTogglePin<CR>")
|
|
||||||
-- Close buffer
|
|
||||||
Nmap("<A-x>", "<Cmd>bdelete<CR>")
|
|
||||||
Nmap("<A-X>", "<Cmd>bdelete!<CR>")
|
|
||||||
-- create new buffer
|
|
||||||
Nmap("<A-c>", "<Cmd>enew<CR>")
|
|
||||||
-- pick buffer
|
|
||||||
Nmap("<A-space>", "<Cmd>BufferLinePick<CR>")
|
|
||||||
-- Sort automatically by...
|
|
||||||
Nmap("<Space>bd", "<Cmd>BufferLineSortByDirectory<CR>")
|
|
||||||
Nmap("<Space>bl", "<Cmd>BufferLineSortByExtension<CR>")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- bottom bar
|
-- bottom bar
|
||||||
use({
|
use({
|
||||||
"feline-nvim/feline.nvim",
|
"feline-nvim/feline.nvim",
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
requires = "kyazdani42/nvim-web-devicons",
|
||||||
after = { "catppuccin" },
|
after = { "catppuccin" },
|
||||||
config = function()
|
config = function()
|
||||||
require("config/feline")
|
require("config/feline")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- DJI Osmo
|
-- DJI Osmo
|
||||||
use({
|
use({
|
||||||
"luukvbaal/stabilize.nvim",
|
"luukvbaal/stabilize.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("stabilize").setup()
|
require("stabilize").setup()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- syntax
|
-- syntax
|
||||||
use({
|
use({
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
run = function()
|
||||||
config = function()
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
require("config/treesitter")
|
end,
|
||||||
end,
|
config = function()
|
||||||
})
|
require("config/treesitter")
|
||||||
use({ "p00f/nvim-ts-rainbow", requires = "nvim-treesitter/nvim-treesitter" })
|
end,
|
||||||
|
})
|
||||||
|
use({ "p00f/nvim-ts-rainbow", requires = "nvim-treesitter/nvim-treesitter" })
|
||||||
|
|
||||||
-- show possible key combos
|
-- show possible key combos
|
||||||
use({
|
use({
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("which-key").setup({})
|
require("which-key").setup({})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
-- we IDE now
|
|
||||||
use({
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
config = function()
|
|
||||||
require("notify").setup({
|
|
||||||
fps = 60,
|
|
||||||
timeout = 2500,
|
|
||||||
stages = "fade",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- syntax
|
-- syntax
|
||||||
use("alker0/chezmoi.vim")
|
use("alker0/chezmoi.vim")
|
||||||
use("digitaltoad/vim-pug")
|
use("digitaltoad/vim-pug")
|
||||||
use("ron-rs/ron.vim")
|
use("ron-rs/ron.vim")
|
||||||
use("elkowar/yuck.vim")
|
use("elkowar/yuck.vim")
|
||||||
|
|
||||||
-- tooling
|
-- tooling
|
||||||
use({
|
use("gpanders/editorconfig.nvim")
|
||||||
"editorconfig/editorconfig-vim",
|
-- read and write encrypted pgp files
|
||||||
config = function()
|
use("jamessan/vim-gnupg")
|
||||||
-- add fugitive buffers to the editorconfig excludes
|
|
||||||
vim.g.EditorConfig_exclude_patterns = { "fugitive://.*", "scp://.*" }
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
-- read and write encrypted pgp files
|
|
||||||
use("jamessan/vim-gnupg")
|
|
||||||
|
|
||||||
-- additional functionality
|
-- additional functionality
|
||||||
use("tpope/vim-commentary")
|
use({
|
||||||
use("tpope/vim-surround")
|
"numToStr/Comment.nvim",
|
||||||
use("ggandor/lightspeed.nvim")
|
config = function()
|
||||||
-- make those above work in repeat commands
|
require("Comment").setup()
|
||||||
use("tpope/vim-repeat")
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
config = function()
|
||||||
|
require("nvim-surround").setup({})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use("ggandor/lightspeed.nvim")
|
||||||
|
-- make those above work in repeat commands
|
||||||
|
|
||||||
use({
|
use({
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-autopairs").setup({})
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp = require("cmp")
|
||||||
local cmp = require("cmp")
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
end,
|
||||||
end,
|
})
|
||||||
})
|
use({
|
||||||
use({
|
"windwp/nvim-ts-autotag",
|
||||||
"windwp/nvim-ts-autotag",
|
config = function()
|
||||||
config = function()
|
require("nvim-ts-autotag").setup()
|
||||||
require("nvim-ts-autotag").setup()
|
end,
|
||||||
end,
|
})
|
||||||
})
|
--
|
||||||
use({
|
-- git
|
||||||
"heavenshell/vim-jsdoc",
|
use("tpope/vim-fugitive")
|
||||||
run = "make install",
|
-- why not both?
|
||||||
config = function()
|
use({
|
||||||
Nmap("<leader>jd", "<Cmd>JsDoc<CR>")
|
"TimUntersberger/neogit",
|
||||||
end,
|
requires = "nvim-lua/plenary.nvim",
|
||||||
})
|
config = function()
|
||||||
|
Nmap("<leader>ng", "<Cmd>Neogit<CR>")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use("dhruvasagar/vim-table-mode")
|
||||||
|
use({
|
||||||
|
"kyazdani42/nvim-tree.lua",
|
||||||
|
config = function()
|
||||||
|
require("nvim-tree").setup({ update_cwd = true })
|
||||||
|
Nmap("<C-n>", ":NvimTreeToggle<CR>")
|
||||||
|
Nmap("<leader>r", ":NvimTreeRefresh<CR>")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"nvchad/nvim-colorizer.lua",
|
||||||
|
config = function()
|
||||||
|
require("config/colorizer")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"simrat39/symbols-outline.nvim",
|
||||||
|
config = function()
|
||||||
|
require("symbols-outline").setup()
|
||||||
|
Nmap("<leader>so", ":SymbolsOutline<CR>")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- git
|
-- databases
|
||||||
use("tpope/vim-fugitive")
|
use({
|
||||||
-- why not both?
|
"kristijanhusak/vim-dadbod-ui",
|
||||||
use({
|
requires = "tpope/vim-dadbod",
|
||||||
"TimUntersberger/neogit",
|
config = function()
|
||||||
requires = "nvim-lua/plenary.nvim",
|
Nmap("<leader>db", ":DBUIToggle<CR>")
|
||||||
config = function()
|
vim.g.db_ui_use_nerd_fonts = true
|
||||||
Nmap("<leader>ng", "<Cmd>Neogit<CR>")
|
vim.g.db_ui_win_position = "right"
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
use("christoomey/vim-sort-motion")
|
use({
|
||||||
use("dhruvasagar/vim-table-mode")
|
"kristijanhusak/vim-dadbod-completion",
|
||||||
use({
|
requires = { { "tpope/vim-dadbod" }, { "hrsh7th/nvim-cmp" } },
|
||||||
"kyazdani42/nvim-tree.lua",
|
config = function()
|
||||||
config = function()
|
require("cmp").setup.buffer({
|
||||||
require("nvim-tree").setup({ update_cwd = true })
|
sources = { { name = "vim-dadbod-completion" } },
|
||||||
Nmap("<C-n>", ":NvimTreeToggle<CR>")
|
})
|
||||||
Nmap("<leader>r", ":NvimTreeRefresh<CR>")
|
end,
|
||||||
end,
|
})
|
||||||
})
|
|
||||||
use({
|
|
||||||
"RRethy/vim-hexokinase",
|
|
||||||
run = "make",
|
|
||||||
config = function()
|
|
||||||
vim.g.Hexokinase_highlighters = { "virtual" }
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"simrat39/symbols-outline.nvim",
|
|
||||||
config = function()
|
|
||||||
Nmap("<leader>so", ":SymbolsOutline<CR>")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- databases
|
-- telescope
|
||||||
use({
|
use({
|
||||||
"kristijanhusak/vim-dadbod-ui",
|
"nvim-telescope/telescope.nvim",
|
||||||
requires = "tpope/vim-dadbod",
|
requires = "nvim-lua/plenary.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
Nmap("<leader>db", ":DBUIToggle<CR>")
|
-- Find files using Telescope command-line sugar.
|
||||||
vim.g.db_ui_use_nerd_fonts = true
|
Nmap("<leader>fc", "<cmd>Telescope conventional_commits<CR>")
|
||||||
vim.g.db_ui_win_position = "right"
|
Nmap("<leader>fr", "<cmd>Telescope asynctasks all<CR>")
|
||||||
end,
|
Nmap("<leader>ff", "<cmd>Telescope find_files<CR>")
|
||||||
})
|
Nmap("<leader>fg", "<cmd>Telescope live_grep<CR>")
|
||||||
use({
|
Nmap("<leader>fb", "<cmd>Telescope buffers<CR>")
|
||||||
"kristijanhusak/vim-dadbod-completion",
|
Nmap("<leader>fh", "<cmd>Telescope help_tags<CR>")
|
||||||
requires = { { "tpope/vim-dadbod" }, { "hrsh7th/nvim-cmp" } },
|
end,
|
||||||
config = function()
|
})
|
||||||
require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } } })
|
use({
|
||||||
end,
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
})
|
run = "make",
|
||||||
|
requires = "nvim-telescope/telescope.nvim",
|
||||||
|
config = function()
|
||||||
|
local telescope = require("telescope")
|
||||||
|
telescope.setup({
|
||||||
|
extensions = {
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true,
|
||||||
|
override_generic_sorter = true,
|
||||||
|
override_file_sorter = true,
|
||||||
|
case_mode = "smart_case",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
telescope.load_extension("fzf")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("file_browser")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"nvim-telescope/telescope-project.nvim",
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("project")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"nvim-telescope/telescope-packer.nvim",
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("packer")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"olacin/telescope-cc.nvim",
|
||||||
|
requires = {
|
||||||
|
{ "nvim-telescope/telescope.nvim" },
|
||||||
|
{ "nvim-lua/popup.nvim" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("conventional_commits")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- telescope
|
use({
|
||||||
use({
|
"andweeb/presence.nvim",
|
||||||
"nvim-telescope/telescope.nvim",
|
config = function()
|
||||||
requires = "nvim-lua/plenary.nvim",
|
require("config/presence")
|
||||||
config = function()
|
end,
|
||||||
-- Find files using Telescope command-line sugar.
|
})
|
||||||
Nmap("<leader>fc", "<cmd>Telescope conventional_commits<CR>")
|
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" })
|
||||||
Nmap("<leader>fr", "<cmd>Telescope asynctasks all<CR>")
|
|
||||||
Nmap("<leader>ff", "<cmd>Telescope find_files<CR>")
|
|
||||||
Nmap("<leader>fg", "<cmd>Telescope live_grep<CR>")
|
|
||||||
Nmap("<leader>fb", "<cmd>Telescope buffers<CR>")
|
|
||||||
Nmap("<leader>fh", "<cmd>Telescope help_tags<CR>")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
|
||||||
run = "make",
|
|
||||||
requires = "nvim-telescope/telescope.nvim",
|
|
||||||
config = function()
|
|
||||||
local telescope = require("telescope")
|
|
||||||
telescope.setup({
|
|
||||||
extensions = {
|
|
||||||
fzf = {
|
|
||||||
fuzzy = true,
|
|
||||||
override_generic_sorter = true,
|
|
||||||
override_file_sorter = true,
|
|
||||||
case_mode = "smart_case",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
telescope.load_extension("fzf")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"nvim-telescope/telescope-file-browser.nvim",
|
|
||||||
config = function()
|
|
||||||
require("telescope").load_extension("file_browser")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"nvim-telescope/telescope-project.nvim",
|
|
||||||
config = function()
|
|
||||||
require("telescope").load_extension("project")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"olacin/telescope-cc.nvim",
|
|
||||||
requires = {
|
|
||||||
{ "nvim-telescope/telescope.nvim" },
|
|
||||||
{ "nvim-lua/popup.nvim" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("telescope").load_extension("conventional_commits")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"sudormrfbin/cheatsheet.nvim",
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
-- external extensions
|
||||||
"andweeb/presence.nvim",
|
use("williamboman/mason.nvim")
|
||||||
config = function()
|
-- LSP
|
||||||
require("config/presence")
|
use("williamboman/mason-lspconfig.nvim")
|
||||||
end,
|
use("neovim/nvim-lspconfig")
|
||||||
})
|
-- completion
|
||||||
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" })
|
use("hrsh7th/nvim-cmp")
|
||||||
|
use("hrsh7th/cmp-buffer")
|
||||||
|
use("hrsh7th/cmp-cmdline")
|
||||||
|
use("hrsh7th/cmp-nvim-lsp")
|
||||||
|
use("hrsh7th/cmp-path")
|
||||||
|
use("hrsh7th/cmp-vsnip")
|
||||||
|
use("hrsh7th/vim-vsnip")
|
||||||
|
use("petertriho/cmp-git")
|
||||||
|
|
||||||
-- external extensions
|
use({
|
||||||
use("williamboman/mason.nvim")
|
"simrat39/rust-tools.nvim",
|
||||||
-- LSP
|
config = function()
|
||||||
use("williamboman/mason-lspconfig.nvim")
|
require("rust-tools").setup({})
|
||||||
use("neovim/nvim-lspconfig")
|
end,
|
||||||
-- completion
|
})
|
||||||
use("hrsh7th/nvim-cmp")
|
use("b0o/schemastore.nvim")
|
||||||
use("hrsh7th/cmp-buffer")
|
--
|
||||||
use("hrsh7th/cmp-cmdline")
|
use({
|
||||||
use("hrsh7th/cmp-nvim-lsp")
|
"folke/trouble.nvim",
|
||||||
use("hrsh7th/cmp-path")
|
config = function()
|
||||||
use("hrsh7th/cmp-vsnip")
|
require("trouble").setup({})
|
||||||
use("hrsh7th/vim-vsnip")
|
end,
|
||||||
use("petertriho/cmp-git")
|
})
|
||||||
-- other
|
use({
|
||||||
use({
|
"glepnir/lspsaga.nvim",
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
config = function()
|
||||||
config = function()
|
require("config/lspsaga")
|
||||||
local null_ls = require("null-ls")
|
end,
|
||||||
null_ls.setup({
|
})
|
||||||
sources = {
|
--
|
||||||
null_ls.builtins.formatting.gofmt,
|
use({
|
||||||
null_ls.builtins.formatting.prettier,
|
"github/copilot.vim",
|
||||||
null_ls.builtins.formatting.rustfmt,
|
config = function()
|
||||||
null_ls.builtins.formatting.stylua,
|
Imap(
|
||||||
},
|
"<C-J>",
|
||||||
})
|
"copilot#Accept(<Tab>)",
|
||||||
end,
|
{ noremap = true, silent = true, expr = true }
|
||||||
requires = { "nvim-lua/plenary.nvim" },
|
)
|
||||||
})
|
vim.g.copilot_no_tab_map = true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
use({
|
-- organization
|
||||||
"simrat39/rust-tools.nvim",
|
use({
|
||||||
config = function()
|
"vimwiki/vimwiki",
|
||||||
require("rust-tools").setup({})
|
branch = "dev",
|
||||||
end,
|
config = function()
|
||||||
})
|
vim.g.vimwiki_global_ext = 0
|
||||||
use("b0o/schemastore.nvim")
|
vim.g.vimwiki_list = {
|
||||||
--
|
{
|
||||||
use({
|
auto_export = 1,
|
||||||
"folke/trouble.nvim",
|
path = "~/.local/share/vimwiki/",
|
||||||
config = function()
|
syntax = "markdown",
|
||||||
require("trouble").setup({})
|
ext = ".md",
|
||||||
end,
|
path_html = "~/vimwiki/",
|
||||||
})
|
template_path = "~/.config/vimwiki/templates/",
|
||||||
use({
|
template_default = "default",
|
||||||
"glepnir/lspsaga.nvim",
|
template_ext = ".tpl",
|
||||||
config = function()
|
custom_wiki2html = "vimwiki_markdown",
|
||||||
require("config/lspsaga")
|
html_filename_parameterization = 1,
|
||||||
end,
|
},
|
||||||
})
|
}
|
||||||
--
|
end,
|
||||||
use({
|
})
|
||||||
"github/copilot.vim",
|
use("tools-life/taskwiki")
|
||||||
config = function()
|
use({
|
||||||
Imap("<C-J>", "copilot#Accept(<Tab>)", { noremap = true, silent = true, expr = true })
|
"skywind3000/asyncrun.vim",
|
||||||
vim.g.copilot_no_tab_map = true
|
config = function()
|
||||||
end,
|
vim.g.asyncrun_open = 6
|
||||||
})
|
end,
|
||||||
|
})
|
||||||
|
use({ "skywind3000/asynctasks.vim" })
|
||||||
|
use({
|
||||||
|
"GustavoKatel/telescope-asynctasks.nvim",
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("asynctasks")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- organization
|
-- startup
|
||||||
use({
|
use({
|
||||||
"vimwiki/vimwiki",
|
"glepnir/dashboard-nvim",
|
||||||
branch = "dev",
|
config = function()
|
||||||
config = function()
|
require("config/dashboard")
|
||||||
vim.g.vimwiki_global_ext = 0
|
end,
|
||||||
vim.g.vimwiki_list = {
|
})
|
||||||
{
|
|
||||||
auto_export = 1,
|
|
||||||
path = "~/.local/share/vimwiki/",
|
|
||||||
syntax = "markdown",
|
|
||||||
ext = ".md",
|
|
||||||
path_html = "~/vimwiki/",
|
|
||||||
template_path = "~/.config/vimwiki/templates/",
|
|
||||||
template_default = "default",
|
|
||||||
template_ext = ".tpl",
|
|
||||||
custom_wiki2html = "vimwiki_markdown",
|
|
||||||
html_filename_parameterization = 1,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use("tools-life/taskwiki")
|
|
||||||
use({
|
|
||||||
"skywind3000/asyncrun.vim",
|
|
||||||
config = function()
|
|
||||||
vim.g.asyncrun_open = 6
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({ "skywind3000/asynctasks.vim" })
|
|
||||||
use({
|
|
||||||
"GustavoKatel/telescope-asynctasks.nvim",
|
|
||||||
config = function()
|
|
||||||
require("telescope").load_extension("asynctasks")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- startup
|
-- automatic theme switching
|
||||||
use({
|
if vim.fn.has("macunix") then
|
||||||
"glepnir/dashboard-nvim",
|
use({
|
||||||
config = function()
|
"f-person/auto-dark-mode.nvim",
|
||||||
require("config/dashboard")
|
config = function()
|
||||||
end,
|
local auto_dark_mode = require("auto-dark-mode")
|
||||||
})
|
auto_dark_mode.setup({
|
||||||
|
---@diagnostic disable-next-line: assign-type-mismatch
|
||||||
-- automatic theme switching
|
update_interval = 1000,
|
||||||
use({
|
set_dark_mode = function()
|
||||||
"f-person/auto-dark-mode.nvim",
|
vim.cmd("Catppuccin frappe")
|
||||||
config = function()
|
end,
|
||||||
local auto_dark_mode = require("auto-dark-mode")
|
set_light_mode = function()
|
||||||
auto_dark_mode.setup({
|
vim.cmd("Catppuccin latte")
|
||||||
---@diagnostic disable-next-line: assign-type-mismatch
|
end,
|
||||||
update_interval = 1000,
|
})
|
||||||
set_dark_mode = function()
|
auto_dark_mode.init()
|
||||||
vim.cmd("Catppuccin frappe")
|
end,
|
||||||
end,
|
})
|
||||||
set_light_mode = function()
|
end
|
||||||
vim.cmd("Catppuccin latte")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
auto_dark_mode.init()
|
|
||||||
end,
|
|
||||||
cond = vim.fn.has("macunix"),
|
|
||||||
})
|
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
local function map(mode, shortcut, command, opt)
|
local function map(mode, shortcut, command, opt)
|
||||||
vim.keymap.set(mode, shortcut, command, opt)
|
vim.keymap.set(mode, shortcut, command, opt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Nmap(shortcut, command, opt)
|
function Nmap(shortcut, command, opt)
|
||||||
opt = opt or { noremap = true, silent = true }
|
opt = opt or { noremap = true, silent = true }
|
||||||
map("n", shortcut, command, opt)
|
map("n", shortcut, command, opt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Imap(shortcut, command, opt)
|
function Imap(shortcut, command, opt)
|
||||||
opt = opt or { noremap = true, silent = true }
|
opt = opt or { noremap = true, silent = true }
|
||||||
map("i", shortcut, command, opt)
|
map("i", shortcut, command, opt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Xmap(shortcut, command, opt)
|
function Xmap(shortcut, command, opt)
|
||||||
opt = opt or { noremap = true, silent = true }
|
opt = opt or { noremap = true, silent = true }
|
||||||
map("x", shortcut, command, opt)
|
map("x", shortcut, command, opt)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue