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-L>", "<C-W>l")
|
||||
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
|
||||
vim.cmd([[tnoremap <Esc> <C-\><C-n>]])
|
||||
|
||||
|
@ -45,9 +51,9 @@ vim.o.expandtab = true
|
|||
-- indentation autocmds for some filetypes
|
||||
vim.cmd([[
|
||||
" 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
|
||||
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
|
||||
autocmd FileType python,rust setlocal ts=4 sw=4 sts=4 et
|
||||
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
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = "*.lua",
|
||||
callback = function()
|
||||
local cfg_path = vim.fn.resolve(vim.fn.stdpath("config"))
|
||||
vim.defer_fn(function()
|
||||
if vim.fn.expand("%:p"):match(cfg_path) then
|
||||
vim.cmd("silent! PackerCompile")
|
||||
end
|
||||
end, 0)
|
||||
end,
|
||||
pattern = "*.lua",
|
||||
callback = function()
|
||||
local cfg_path = vim.fn.resolve(vim.fn.stdpath("config"))
|
||||
vim.defer_fn(function()
|
||||
if vim.fn.expand("%:p"):match(cfg_path) then
|
||||
vim.cmd("silent! PackerCompile")
|
||||
end
|
||||
end, 0)
|
||||
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 {{{
|
||||
if vim.g.neovide then
|
||||
vim.cmd("cd $HOME")
|
||||
vim.g.neovide_cursor_vfx_mode = "ripple"
|
||||
vim.g.neovide_input_macos_alt_is_meta = true
|
||||
vim.o.guifont = "VictorMono Nerd Font:h18"
|
||||
vim.cmd("cd $HOME")
|
||||
vim.g.neovide_cursor_vfx_mode = "ripple"
|
||||
vim.g.neovide_input_macos_alt_is_meta = true
|
||||
vim.o.guifont = "VictorMono Nerd Font:h18"
|
||||
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
|
||||
vim.g.catppuccin_flavour = "mocha"
|
||||
local colors = require("catppuccin.palettes").get_palette()
|
||||
vim.g.catppuccin_flavour = "frappe"
|
||||
|
||||
require("catppuccin").setup({
|
||||
transparent_background = false,
|
||||
term_colors = true,
|
||||
dim_inactive = {
|
||||
enable = false,
|
||||
shade = "dark",
|
||||
percentage = 0.05,
|
||||
},
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
},
|
||||
integrations = {
|
||||
treesitter = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
},
|
||||
cmp = true,
|
||||
coc_nvim = false,
|
||||
lsp_saga = true,
|
||||
lsp_trouble = true,
|
||||
nvimtree = {
|
||||
enabled = false,
|
||||
},
|
||||
neotree = {
|
||||
enabled = true,
|
||||
show_root = false,
|
||||
transparent_panel = false,
|
||||
},
|
||||
which_key = true,
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
colored_indent_levels = true,
|
||||
},
|
||||
barbar = false,
|
||||
bufferline = true,
|
||||
dashboard = true,
|
||||
fern = false,
|
||||
gitgutter = false,
|
||||
gitsigns = true,
|
||||
hop = false,
|
||||
leap = false,
|
||||
lightspeed = true,
|
||||
markdown = true,
|
||||
neogit = true,
|
||||
notify = false,
|
||||
symbols_outline = true,
|
||||
telekasten = false,
|
||||
telescope = true,
|
||||
ts_rainbow = true,
|
||||
vim_sneak = false,
|
||||
}
|
||||
dim_inactive = {
|
||||
enable = true,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
},
|
||||
integrations = {
|
||||
treesitter = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
},
|
||||
cmp = true,
|
||||
coc_nvim = false,
|
||||
lsp_saga = true,
|
||||
lsp_trouble = true,
|
||||
nvimtree = {
|
||||
enabled = false,
|
||||
},
|
||||
neotree = {
|
||||
enabled = true,
|
||||
show_root = false,
|
||||
transparent_panel = false,
|
||||
},
|
||||
which_key = true,
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
colored_indent_levels = true,
|
||||
},
|
||||
barbar = false,
|
||||
bufferline = true,
|
||||
dashboard = false,
|
||||
fern = false,
|
||||
gitgutter = false,
|
||||
gitsigns = true,
|
||||
hop = false,
|
||||
leap = false,
|
||||
lightspeed = true,
|
||||
markdown = true,
|
||||
neogit = true,
|
||||
notify = false,
|
||||
symbols_outline = true,
|
||||
telekasten = false,
|
||||
telescope = true,
|
||||
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 db = require("dashboard")
|
||||
|
||||
db.custom_header = function()
|
||||
local quotes = {
|
||||
"Demonic presence at unsafe levels.",
|
||||
"Rip and tear, until it is done.",
|
||||
"So you walk eternally through the shadow realms.",
|
||||
"The only thing they fear... is you.",
|
||||
"There he lies still, and ever more, in silent suffering.",
|
||||
"We will send unto them...only you.",
|
||||
"What you see now in this facility is the cost. Of progress.",
|
||||
"You can't just shoot a hole in the surface of mars!",
|
||||
"WARNING: The Slayer has entered the facility.",
|
||||
"DANGER: THE SLAYER HAS CONTROL OF THE BFG.",
|
||||
}
|
||||
local random_quote = quotes[math.random(#quotes)]
|
||||
return {
|
||||
[[]],
|
||||
[[ _ _ _____ _ _ _____ _____ _____ _ _ _ _ ________ ___]],
|
||||
[[| | | |_ _| \ | |/ ___|_ _| _ | \ | | | | | |_ _| \/ |]],
|
||||
[[| | | | | | | \| |\ `--. | | | | | | \| | | | | | | | | . . |]],
|
||||
[[| |/\| | | | | . ` | `--. \ | | | | | | . ` | | | | | | | | |\/| |]],
|
||||
[[\ /\ /_| |_| |\ |/\__/ / | | \ \_/ / |\ | _ \ \_/ /_| |_| | | |]],
|
||||
[[ \/ \/ \___/\_| \_/\____/ \_/ \___/\_| \_/ (_) \___/ \___/\_| |_/]],
|
||||
[[]],
|
||||
random_quote,
|
||||
[[]],
|
||||
}
|
||||
local quotes = {
|
||||
"Demonic presence at unsafe levels.",
|
||||
"Rip and tear, until it is done.",
|
||||
"So you walk eternally through the shadow realms.",
|
||||
"The only thing they fear... is you.",
|
||||
"There he lies still, and ever more, in silent suffering.",
|
||||
"We will send unto them...only you.",
|
||||
"What you see now in this facility is the cost. Of progress.",
|
||||
"You can't just shoot a hole in the surface of mars!",
|
||||
"WARNING: The Slayer has entered the facility.",
|
||||
"DANGER: THE SLAYER HAS CONTROL OF THE BFG.",
|
||||
}
|
||||
local random_quote = quotes[math.random(#quotes)]
|
||||
return {
|
||||
[[]],
|
||||
[[ _ _ _____ _ _ _____ _____ _____ _ _ _ _ ________ ___]],
|
||||
[[| | | |_ _| \ | |/ ___|_ _| _ | \ | | | | | |_ _| \/ |]],
|
||||
[[| | | | | | | \| |\ `--. | | | | | | \| | | | | | | | | . . |]],
|
||||
[[| |/\| | | | | . ` | `--. \ | | | | | | . ` | | | | | | | | |\/| |]],
|
||||
[[\ /\ /_| |_| |\ |/\__/ / | | \ \_/ / |\ | _ \ \_/ /_| |_| | | |]],
|
||||
[[ \/ \/ \___/\_| \_/\____/ \_/ \___/\_| \_/ (_) \___/ \___/\_| |_/]],
|
||||
[[]],
|
||||
random_quote,
|
||||
[[]],
|
||||
}
|
||||
end
|
||||
|
||||
db.custom_center = {
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Restore latest session ",
|
||||
action = "SessionLoad",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Open Projects ",
|
||||
action = "Telescope project",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find File ",
|
||||
action = "Telescope find_files find_command=rg,--hidden,--files",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "File Browser ",
|
||||
action = "Telescope file_browser",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find word ",
|
||||
action = "Telescope live_grep",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Open Settings ",
|
||||
action = function()
|
||||
vim.cmd("cd " .. home .. "/.config/nvim/")
|
||||
vim.cmd("edit init.lua")
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Restore latest session ",
|
||||
action = "SessionLoad",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Open Projects ",
|
||||
action = "Telescope project",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find File ",
|
||||
action = "Telescope find_files find_command=rg,--hidden,--files",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "File Browser ",
|
||||
action = "Telescope file_browser",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find word ",
|
||||
action = "Telescope live_grep",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Open Settings ",
|
||||
action = function()
|
||||
vim.cmd("cd " .. home .. "/.config/nvim/")
|
||||
vim.cmd("edit init.lua")
|
||||
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")
|
||||
|
||||
ctp_feline.setup({
|
||||
assets = {
|
||||
left_separator = "",
|
||||
right_separator = "",
|
||||
bar = "█",
|
||||
mode_icon = " ",
|
||||
},
|
||||
sett = {
|
||||
show_modified = true,
|
||||
curr_dir = clrs.mauve,
|
||||
curr_file = clrs.blue,
|
||||
},
|
||||
assets = {
|
||||
left_separator = "",
|
||||
right_separator = "",
|
||||
bar = "█",
|
||||
mode_icon = " ",
|
||||
dir = " ",
|
||||
file = " ",
|
||||
git = {
|
||||
branch = " ",
|
||||
},
|
||||
},
|
||||
sett = {
|
||||
show_modified = true,
|
||||
curr_dir = clrs.mauve,
|
||||
curr_file = clrs.blue,
|
||||
},
|
||||
mode_colors = {
|
||||
["n"] = { "NORMAL", clrs.blue },
|
||||
},
|
||||
})
|
||||
|
||||
require("feline").setup({
|
||||
components = ctp_feline.get(),
|
||||
force_inactive = {
|
||||
filetypes = {
|
||||
"^packer$",
|
||||
"^startify$",
|
||||
"^fugitive$",
|
||||
"^fugitiveblame$",
|
||||
"^qf$",
|
||||
"^help$",
|
||||
},
|
||||
buftypes = {
|
||||
"^terminal$",
|
||||
},
|
||||
bufnames = {},
|
||||
},
|
||||
components = ctp_feline.get(),
|
||||
force_inactive = {
|
||||
filetypes = {
|
||||
"^packer$",
|
||||
"^startify$",
|
||||
"^fugitive$",
|
||||
"^fugitiveblame$",
|
||||
"^qf$",
|
||||
"^help$",
|
||||
},
|
||||
buftypes = {
|
||||
"^terminal$",
|
||||
},
|
||||
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({
|
||||
signs = {
|
||||
add = {
|
||||
hl = "GitSignsAdd",
|
||||
text = "+",
|
||||
numhl = "GitSignsAddNr",
|
||||
linehl = "GitSignsAddLn",
|
||||
},
|
||||
change = {
|
||||
hl = "GitSignsChange",
|
||||
text = "~",
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
delete = {
|
||||
hl = "GitSignsDelete",
|
||||
text = "_",
|
||||
numhl = "GitSignsDeleteNr",
|
||||
linehl = "GitSignsDeleteLn",
|
||||
},
|
||||
topdelete = {
|
||||
hl = "GitSignsDelete",
|
||||
text = "‾",
|
||||
numhl = "GitSignsDeleteNr",
|
||||
linehl = "GitSignsDeleteLn",
|
||||
},
|
||||
changedelete = {
|
||||
hl = "GitSignsChange",
|
||||
text = "x",
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
},
|
||||
linehl = false,
|
||||
numhl = false,
|
||||
signcolumn = true,
|
||||
word_diff = false,
|
||||
watch_gitdir = { interval = 1000, follow_files = true },
|
||||
attach_to_untracked = true,
|
||||
-- current line highlighting
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
delay = 1000,
|
||||
ignore_whitespace = true,
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
},
|
||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary> | <abbrev_sha>",
|
||||
-- perf
|
||||
max_file_length = 40000,
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
-- use the included status formatter
|
||||
status_formatter = nil,
|
||||
preview_config = {
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = { enable = false },
|
||||
signs = {
|
||||
add = {
|
||||
hl = "GitSignsAdd",
|
||||
text = "+",
|
||||
numhl = "GitSignsAddNr",
|
||||
linehl = "GitSignsAddLn",
|
||||
},
|
||||
change = {
|
||||
hl = "GitSignsChange",
|
||||
text = "~",
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
delete = {
|
||||
hl = "GitSignsDelete",
|
||||
text = "_",
|
||||
numhl = "GitSignsDeleteNr",
|
||||
linehl = "GitSignsDeleteLn",
|
||||
},
|
||||
topdelete = {
|
||||
hl = "GitSignsDelete",
|
||||
text = "‾",
|
||||
numhl = "GitSignsDeleteNr",
|
||||
linehl = "GitSignsDeleteLn",
|
||||
},
|
||||
changedelete = {
|
||||
hl = "GitSignsChange",
|
||||
text = "x",
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
},
|
||||
linehl = false,
|
||||
numhl = false,
|
||||
signcolumn = true,
|
||||
word_diff = false,
|
||||
watch_gitdir = { interval = 1000, follow_files = true },
|
||||
attach_to_untracked = true,
|
||||
-- current line highlighting
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
delay = 1000,
|
||||
ignore_whitespace = true,
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol",
|
||||
},
|
||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary> | <abbrev_sha>",
|
||||
-- perf
|
||||
max_file_length = 40000,
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
-- use the included status formatter
|
||||
status_formatter = nil,
|
||||
preview_config = {
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = { enable = false },
|
||||
})
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
local saga = require("lspsaga")
|
||||
saga.init_lsp_saga()
|
||||
saga.init_lsp_saga({
|
||||
code_action_lightbulb = {
|
||||
enable = false,
|
||||
},
|
||||
})
|
||||
|
||||
Nmap("gr", "<cmd>Lspsaga rename<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("gj", "<cmd>Lspsaga diagnostic_jump_next<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([[
|
||||
nnoremap <silent> <A-d> <cmd>lua require('lspsaga.floaterm').open_float_terminal()<CR>
|
||||
|
|
|
@ -1,110 +1,109 @@
|
|||
function string.starts(self, str)
|
||||
return self:find('^' .. str) ~= nil
|
||||
return self:find("^" .. str) ~= nil
|
||||
end
|
||||
|
||||
local conceal = function()
|
||||
local home = os.getenv("HOME")
|
||||
local blacklist = {
|
||||
[home .. "/git/work"] = "Working...",
|
||||
[home .. "/git/freelance"] = "Freelancing...",
|
||||
[home .. "/git/freelance"] = "Freelancing...",
|
||||
}
|
||||
local home = os.getenv("HOME")
|
||||
local blacklist = {
|
||||
[home .. "/git/work"] = "Using nvim at work.",
|
||||
[home .. "/git/freelance"] = "Using nvim to freelance.",
|
||||
}
|
||||
|
||||
local cur_file = vim.fn.expand("%:p")
|
||||
for k, v in pairs(blacklist) do
|
||||
if cur_file:starts(k) then
|
||||
return v
|
||||
end
|
||||
end
|
||||
return false
|
||||
local cur_file = vim.fn.expand("%:p")
|
||||
for k, v in pairs(blacklist) do
|
||||
if cur_file:starts(k) then
|
||||
return v
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
require("presence"):setup({
|
||||
-- General options
|
||||
auto_update = true,
|
||||
neovim_image_text = "The Soydev's Kryptonite",
|
||||
-- Main image display (either "neovim" or "file")
|
||||
main_image = "file",
|
||||
-- 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
|
||||
buttons = function(buffer, repo_url)
|
||||
-- ignore where no repo_url is set
|
||||
if repo_url == nil then
|
||||
return false
|
||||
end
|
||||
-- General options
|
||||
auto_update = true,
|
||||
neovim_image_text = "The Soydev's Kryptonite",
|
||||
-- Main image display (either "neovim" or "file")
|
||||
main_image = "file",
|
||||
-- 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
|
||||
buttons = function(buffer, repo_url)
|
||||
-- ignore where no repo_url is set
|
||||
if repo_url == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
-- only show certain org/user repos, don't leak clients or work
|
||||
local visible_urls = {
|
||||
"github.com/catppuccin",
|
||||
"github.com/farbenfroh",
|
||||
"github.com/nekowinston",
|
||||
}
|
||||
-- only show certain org/user repos, don't leak clients or work
|
||||
local visible_urls = {
|
||||
"github.com/catppuccin",
|
||||
"github.com/farbenfroh",
|
||||
"github.com/nekowinston",
|
||||
}
|
||||
|
||||
-- check if repo_url is in the list of visible urls
|
||||
for _, visible_url in ipairs(visible_urls) do
|
||||
if repo_url:find(visible_url) then
|
||||
return {
|
||||
{
|
||||
label = "Steal the code",
|
||||
url = repo_url,
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
-- check if repo_url is in the list of visible urls
|
||||
for _, visible_url in ipairs(visible_urls) do
|
||||
if repo_url:find(visible_url) then
|
||||
return {
|
||||
{
|
||||
label = "Steal the code",
|
||||
url = repo_url,
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
-- if not, return false
|
||||
return false
|
||||
end,
|
||||
debounce_timeout = 10,
|
||||
file_assets = {
|
||||
["k8s.yaml"] = {
|
||||
"Kubernetes",
|
||||
"https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png",
|
||||
},
|
||||
["Chart.yaml"] = {
|
||||
"Helm Chart",
|
||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||
},
|
||||
["helmfile.yaml"] = {
|
||||
"helmfile",
|
||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||
},
|
||||
["prisma"] = {
|
||||
"Prisma",
|
||||
"https://avatars.githubusercontent.com/u/17219288"
|
||||
}
|
||||
},
|
||||
-- Rich Presence text options
|
||||
editing_text = function(s)
|
||||
local concealed = conceal()
|
||||
if concealed then
|
||||
return concealed
|
||||
end
|
||||
return "✍️ " .. s
|
||||
end,
|
||||
reading_text = function(s)
|
||||
local concealed = conceal()
|
||||
if concealed then
|
||||
return concealed
|
||||
end
|
||||
return "📖 " .. s
|
||||
end,
|
||||
file_explorer_text = function(s)
|
||||
local concealed = conceal()
|
||||
if concealed then
|
||||
return concealed
|
||||
end
|
||||
return "📁 " .. s
|
||||
end,
|
||||
workspace_text = function(s)
|
||||
local concealed = conceal()
|
||||
if s ~= nil and not concealed then
|
||||
return "🗂️ ".. s
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end,
|
||||
git_commit_text = "Committing changes",
|
||||
plugin_manager_text = "🤹 Managing Plugins",
|
||||
line_number_text = "L%s of %s",
|
||||
-- if not, return false
|
||||
return false
|
||||
end,
|
||||
debounce_timeout = 10,
|
||||
file_assets = {
|
||||
["k8s.yaml"] = {
|
||||
"Kubernetes",
|
||||
"https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png",
|
||||
},
|
||||
["Chart.yaml"] = {
|
||||
"Helm Chart",
|
||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||
},
|
||||
["helmfile.yaml"] = {
|
||||
"helmfile",
|
||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||
},
|
||||
["prisma"] = {
|
||||
"Prisma",
|
||||
"https://avatars.githubusercontent.com/u/17219288",
|
||||
},
|
||||
},
|
||||
-- Rich Presence text options
|
||||
editing_text = function(s)
|
||||
local concealed = conceal()
|
||||
if concealed then
|
||||
return concealed
|
||||
end
|
||||
return "Editing " .. s
|
||||
end,
|
||||
reading_text = function(s)
|
||||
local concealed = conceal()
|
||||
if concealed then
|
||||
return concealed
|
||||
end
|
||||
return "Reading " .. s
|
||||
end,
|
||||
file_explorer_text = function(s)
|
||||
local concealed = conceal()
|
||||
if concealed then
|
||||
return concealed
|
||||
end
|
||||
return "Working in " .. s
|
||||
end,
|
||||
workspace_text = function(s)
|
||||
local concealed = conceal()
|
||||
if s ~= nil and not concealed then
|
||||
return "Working on " .. s
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end,
|
||||
git_commit_text = "Committing changes",
|
||||
plugin_manager_text = "Managing Plugins",
|
||||
line_number_text = "L%s of %s",
|
||||
})
|
||||
|
|
|
@ -1,65 +1,45 @@
|
|||
require("nvim-treesitter.configs").setup({
|
||||
auto_install = true,
|
||||
ignore_install = {
|
||||
-- woulnd't install sometimes, not needed
|
||||
"phpdoc",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"cmake",
|
||||
"comment",
|
||||
"cpp",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"fish",
|
||||
"gdscript",
|
||||
"glsl",
|
||||
"go",
|
||||
"godot_resource",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"graphql",
|
||||
"help",
|
||||
"hjson",
|
||||
"html",
|
||||
"http",
|
||||
"java",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"json5",
|
||||
"jsonc",
|
||||
"kotlin",
|
||||
"latex",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"ninja",
|
||||
"perl",
|
||||
"php",
|
||||
"prisma",
|
||||
"proto",
|
||||
"pug",
|
||||
"python",
|
||||
"rasi",
|
||||
"regex",
|
||||
"ruby",
|
||||
"rust",
|
||||
"scss",
|
||||
"sql",
|
||||
"svelte",
|
||||
"swift",
|
||||
"teal",
|
||||
"todotxt",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vue",
|
||||
"yaml",
|
||||
},
|
||||
auto_install = true,
|
||||
ignore_install = {
|
||||
-- woulnd't install sometimes, not needed
|
||||
"phpdoc",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"gomod",
|
||||
"graphql",
|
||||
"help",
|
||||
"hjson",
|
||||
"html",
|
||||
"http",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"json5",
|
||||
"jsonc",
|
||||
"latex",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"php",
|
||||
"prisma",
|
||||
"python",
|
||||
"regex",
|
||||
"rust",
|
||||
"scss",
|
||||
"sql",
|
||||
"svelte",
|
||||
"teal",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
})
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
require("mason").setup({
|
||||
ui = {
|
||||
border = "none",
|
||||
icons = {
|
||||
package_installed = " ",
|
||||
package_pending = " ",
|
||||
package_uninstalled = " ",
|
||||
},
|
||||
},
|
||||
ui = {
|
||||
border = "none",
|
||||
icons = {
|
||||
package_installed = " ",
|
||||
package_pending = " ",
|
||||
package_uninstalled = " ",
|
||||
},
|
||||
},
|
||||
})
|
||||
require("mason-lspconfig").setup({ automatic_installation = true })
|
||||
|
||||
|
@ -18,51 +18,53 @@ vim.opt.completeopt = "menu,menuone,noselect"
|
|||
-- Setup nvim-cmp.
|
||||
local present, cmp = pcall(require, "cmp")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<Tab>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "vsnip" },
|
||||
}, { { name = "buffer" } }),
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<Tab>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "vsnip" },
|
||||
}, { { name = "buffer" } }),
|
||||
})
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype("gitcommit", {
|
||||
sources = cmp.config.sources({
|
||||
{ name = "cmp_git" },
|
||||
}, { { name = "buffer" } }),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "cmp_git" },
|
||||
}, { { name = "buffer" } }),
|
||||
})
|
||||
-- search
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = { { name = "buffer" } },
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = { { name = "buffer" } },
|
||||
})
|
||||
-- Use cmdline & path source for ':'
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources(
|
||||
{ {
|
||||
name = "path",
|
||||
option = { trailing_slash = true },
|
||||
} },
|
||||
{ { name = "cmdline" } }
|
||||
),
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources(
|
||||
{ {
|
||||
name = "path",
|
||||
option = { trailing_slash = true },
|
||||
} },
|
||||
{ { name = "cmdline" } }
|
||||
),
|
||||
})
|
||||
|
||||
-- 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.
|
||||
-- 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
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
-- disable diagnostics on Helm files
|
||||
if vim.bo[bufnr].buftype ~= "" or vim.bo[bufnr].filetype == "helm" then
|
||||
vim.diagnostic.disable()
|
||||
end
|
||||
-- disable diagnostics on Helm files
|
||||
if vim.bo[bufnr].buftype ~= "" or vim.bo[bufnr].filetype == "helm" then
|
||||
vim.diagnostic.disable()
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
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.definition, 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", "<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>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set("n", "<space>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, 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>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set("n", "<space>nf", function()
|
||||
end, bufopts)
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
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.definition, 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", "<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>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set("n", "<space>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, 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>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set("n", "<space>nf", function() end, bufopts)
|
||||
end
|
||||
|
||||
local common_config = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
local present, lsp = pcall(require, "lspconfig")
|
||||
if not present then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
lsp.sumneko_lua.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
maxPreload = 100000,
|
||||
preloadFileSize = 10000,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
maxPreload = 100000,
|
||||
preloadFileSize = 10000,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
--- the cool kids
|
||||
|
@ -146,29 +147,31 @@ lsp.rust_analyzer.setup(common_config)
|
|||
|
||||
--- Web Development
|
||||
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
|
||||
lsp.emmet_ls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = emmet_cap,
|
||||
filetypes = {
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"html",
|
||||
"svelte",
|
||||
"css",
|
||||
"less",
|
||||
"sass",
|
||||
"scss",
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = emmet_cap,
|
||||
filetypes = {
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"html",
|
||||
"svelte",
|
||||
"css",
|
||||
"less",
|
||||
"sass",
|
||||
"scss",
|
||||
},
|
||||
})
|
||||
-- lsp.html.setup(common_config)
|
||||
lsp.tailwindcss.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
emmetCompletions = true,
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
emmetCompletions = true,
|
||||
},
|
||||
})
|
||||
|
||||
-- soydev
|
||||
|
@ -176,59 +179,52 @@ lsp.prismals.setup(common_config)
|
|||
lsp.svelte.setup(common_config)
|
||||
-- attach tsserver only when there's a 'package.json' file in the CWD
|
||||
lsp.tsserver.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = lsp.util.root_pattern("package.json"),
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = lsp.util.root_pattern("package.json"),
|
||||
})
|
||||
-- attach deno only when there's a 'deps.ts' file in the CWD
|
||||
lsp.denols.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = lsp.util.root_pattern("deps.ts"),
|
||||
single_file_support = false,
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = lsp.util.root_pattern("deps.ts"),
|
||||
single_file_support = false,
|
||||
})
|
||||
|
||||
-- data formats
|
||||
lsp.dockerls.setup(common_config)
|
||||
lsp.graphql.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = lsp.util.root_pattern(".graphqlrc*", ".graphql.config.*", "graphql.config.*"),
|
||||
settings = {
|
||||
graphql = {
|
||||
schemaPath = "schema.graphql",
|
||||
},
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = lsp.util.root_pattern(
|
||||
".graphqlrc*",
|
||||
".graphql.config.*",
|
||||
"graphql.config.*"
|
||||
),
|
||||
settings = {
|
||||
graphql = {
|
||||
schemaPath = "schema.graphql",
|
||||
},
|
||||
},
|
||||
})
|
||||
lsp.jsonls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
lsp.yamlls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
redhat = {
|
||||
telemetry = {
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
yaml = {
|
||||
["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
--- Documentation
|
||||
|
|
|
@ -2,473 +2,392 @@ require("utils")
|
|||
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
local packer = require("packer")
|
||||
if not packer then
|
||||
return
|
||||
end
|
||||
|
||||
-- slow internet...
|
||||
packer.init({
|
||||
git = { clone_timeout = 180 },
|
||||
profile = {
|
||||
enable = true,
|
||||
},
|
||||
git = { clone_timeout = 180 },
|
||||
profile = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
return packer.startup(function(use)
|
||||
-- Packer managing itself
|
||||
use("wbthomason/packer.nvim")
|
||||
-- startup time or some shit
|
||||
use("lewis6991/impatient.nvim")
|
||||
-- Packer managing itself
|
||||
use("wbthomason/packer.nvim")
|
||||
-- startup time or some shit
|
||||
use("lewis6991/impatient.nvim")
|
||||
|
||||
-- colour scheme
|
||||
use({
|
||||
"catppuccin/nvim",
|
||||
as = "catppuccin",
|
||||
config = function()
|
||||
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,
|
||||
})
|
||||
-- colour scheme
|
||||
use({
|
||||
"catppuccin/nvim",
|
||||
as = "catppuccin",
|
||||
run = ":CatppuccinCompile",
|
||||
config = function()
|
||||
require("config/catppuccin")
|
||||
end,
|
||||
})
|
||||
|
||||
-- git gutter
|
||||
use({
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("config/gitsigns")
|
||||
end,
|
||||
})
|
||||
-- git gutter
|
||||
use({
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("config/gitsigns")
|
||||
end,
|
||||
})
|
||||
|
||||
-- rainbow indents
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
require("indent_blankline").setup({
|
||||
space_char_blankline = " ",
|
||||
show_current_conext = true,
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
"IndentBlanklineIndent3",
|
||||
"IndentBlanklineIndent4",
|
||||
"IndentBlanklineIndent5",
|
||||
"IndentBlanklineIndent6",
|
||||
},
|
||||
})
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"dashboard",
|
||||
"help",
|
||||
"neogitstatus",
|
||||
"fugitive",
|
||||
"packer",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
}
|
||||
end,
|
||||
})
|
||||
-- rainbow indents
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
require("indent_blankline").setup({
|
||||
space_char_blankline = " ",
|
||||
show_current_conext = true,
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
"IndentBlanklineIndent3",
|
||||
"IndentBlanklineIndent4",
|
||||
"IndentBlanklineIndent5",
|
||||
"IndentBlanklineIndent6",
|
||||
},
|
||||
})
|
||||
vim.g.indent_blankline_filetype_exclude = {
|
||||
"dashboard",
|
||||
"help",
|
||||
"neogitstatus",
|
||||
"fugitive",
|
||||
"packer",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
-- top bar
|
||||
use({
|
||||
"akinsho/bufferline.nvim",
|
||||
config = function()
|
||||
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>")
|
||||
end,
|
||||
})
|
||||
-- top bar
|
||||
use({
|
||||
"akinsho/bufferline.nvim",
|
||||
config = function()
|
||||
require("config/bufferline")
|
||||
end,
|
||||
})
|
||||
|
||||
-- bottom bar
|
||||
use({
|
||||
"feline-nvim/feline.nvim",
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
after = { "catppuccin" },
|
||||
config = function()
|
||||
require("config/feline")
|
||||
end,
|
||||
})
|
||||
-- bottom bar
|
||||
use({
|
||||
"feline-nvim/feline.nvim",
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
after = { "catppuccin" },
|
||||
config = function()
|
||||
require("config/feline")
|
||||
end,
|
||||
})
|
||||
|
||||
-- DJI Osmo
|
||||
use({
|
||||
"luukvbaal/stabilize.nvim",
|
||||
config = function()
|
||||
require("stabilize").setup()
|
||||
end,
|
||||
})
|
||||
-- DJI Osmo
|
||||
use({
|
||||
"luukvbaal/stabilize.nvim",
|
||||
config = function()
|
||||
require("stabilize").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- syntax
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
||||
config = function()
|
||||
require("config/treesitter")
|
||||
end,
|
||||
})
|
||||
use({ "p00f/nvim-ts-rainbow", requires = "nvim-treesitter/nvim-treesitter" })
|
||||
-- syntax
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
config = function()
|
||||
require("config/treesitter")
|
||||
end,
|
||||
})
|
||||
use({ "p00f/nvim-ts-rainbow", requires = "nvim-treesitter/nvim-treesitter" })
|
||||
|
||||
-- show possible key combos
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
require("which-key").setup({})
|
||||
end,
|
||||
})
|
||||
-- we IDE now
|
||||
use({
|
||||
"rcarriga/nvim-notify",
|
||||
config = function()
|
||||
require("notify").setup({
|
||||
fps = 60,
|
||||
timeout = 2500,
|
||||
stages = "fade",
|
||||
})
|
||||
end,
|
||||
})
|
||||
-- show possible key combos
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
require("which-key").setup({})
|
||||
end,
|
||||
})
|
||||
|
||||
-- syntax
|
||||
use("alker0/chezmoi.vim")
|
||||
use("digitaltoad/vim-pug")
|
||||
use("ron-rs/ron.vim")
|
||||
use("elkowar/yuck.vim")
|
||||
-- syntax
|
||||
use("alker0/chezmoi.vim")
|
||||
use("digitaltoad/vim-pug")
|
||||
use("ron-rs/ron.vim")
|
||||
use("elkowar/yuck.vim")
|
||||
|
||||
-- tooling
|
||||
use({
|
||||
"editorconfig/editorconfig-vim",
|
||||
config = function()
|
||||
-- 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")
|
||||
-- tooling
|
||||
use("gpanders/editorconfig.nvim")
|
||||
-- read and write encrypted pgp files
|
||||
use("jamessan/vim-gnupg")
|
||||
|
||||
-- additional functionality
|
||||
use("tpope/vim-commentary")
|
||||
use("tpope/vim-surround")
|
||||
use("ggandor/lightspeed.nvim")
|
||||
-- make those above work in repeat commands
|
||||
use("tpope/vim-repeat")
|
||||
-- additional functionality
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"kylechui/nvim-surround",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
})
|
||||
use("ggandor/lightspeed.nvim")
|
||||
-- make those above work in repeat commands
|
||||
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({})
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp = require("cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"windwp/nvim-ts-autotag",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup()
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"heavenshell/vim-jsdoc",
|
||||
run = "make install",
|
||||
config = function()
|
||||
Nmap("<leader>jd", "<Cmd>JsDoc<CR>")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp = require("cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"windwp/nvim-ts-autotag",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup()
|
||||
end,
|
||||
})
|
||||
--
|
||||
-- git
|
||||
use("tpope/vim-fugitive")
|
||||
-- why not both?
|
||||
use({
|
||||
"TimUntersberger/neogit",
|
||||
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
|
||||
use("tpope/vim-fugitive")
|
||||
-- why not both?
|
||||
use({
|
||||
"TimUntersberger/neogit",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
Nmap("<leader>ng", "<Cmd>Neogit<CR>")
|
||||
end,
|
||||
})
|
||||
use("christoomey/vim-sort-motion")
|
||||
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({
|
||||
"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
|
||||
use({
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
requires = "tpope/vim-dadbod",
|
||||
config = function()
|
||||
Nmap("<leader>db", ":DBUIToggle<CR>")
|
||||
vim.g.db_ui_use_nerd_fonts = true
|
||||
vim.g.db_ui_win_position = "right"
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
requires = { { "tpope/vim-dadbod" }, { "hrsh7th/nvim-cmp" } },
|
||||
config = function()
|
||||
require("cmp").setup.buffer({
|
||||
sources = { { name = "vim-dadbod-completion" } },
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- databases
|
||||
use({
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
requires = "tpope/vim-dadbod",
|
||||
config = function()
|
||||
Nmap("<leader>db", ":DBUIToggle<CR>")
|
||||
vim.g.db_ui_use_nerd_fonts = true
|
||||
vim.g.db_ui_win_position = "right"
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
requires = { { "tpope/vim-dadbod" }, { "hrsh7th/nvim-cmp" } },
|
||||
config = function()
|
||||
require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } } })
|
||||
end,
|
||||
})
|
||||
-- telescope
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
-- Find files using Telescope command-line sugar.
|
||||
Nmap("<leader>fc", "<cmd>Telescope conventional_commits<CR>")
|
||||
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({
|
||||
"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({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
-- Find files using Telescope command-line sugar.
|
||||
Nmap("<leader>fc", "<cmd>Telescope conventional_commits<CR>")
|
||||
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({
|
||||
"andweeb/presence.nvim",
|
||||
config = function()
|
||||
require("config/presence")
|
||||
end,
|
||||
})
|
||||
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" })
|
||||
|
||||
use({
|
||||
"andweeb/presence.nvim",
|
||||
config = function()
|
||||
require("config/presence")
|
||||
end,
|
||||
})
|
||||
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" })
|
||||
-- external extensions
|
||||
use("williamboman/mason.nvim")
|
||||
-- LSP
|
||||
use("williamboman/mason-lspconfig.nvim")
|
||||
use("neovim/nvim-lspconfig")
|
||||
-- completion
|
||||
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("williamboman/mason.nvim")
|
||||
-- LSP
|
||||
use("williamboman/mason-lspconfig.nvim")
|
||||
use("neovim/nvim-lspconfig")
|
||||
-- completion
|
||||
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")
|
||||
-- other
|
||||
use({
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.gofmt,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.rustfmt,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
},
|
||||
})
|
||||
end,
|
||||
requires = { "nvim-lua/plenary.nvim" },
|
||||
})
|
||||
use({
|
||||
"simrat39/rust-tools.nvim",
|
||||
config = function()
|
||||
require("rust-tools").setup({})
|
||||
end,
|
||||
})
|
||||
use("b0o/schemastore.nvim")
|
||||
--
|
||||
use({
|
||||
"folke/trouble.nvim",
|
||||
config = function()
|
||||
require("trouble").setup({})
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"glepnir/lspsaga.nvim",
|
||||
config = function()
|
||||
require("config/lspsaga")
|
||||
end,
|
||||
})
|
||||
--
|
||||
use({
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
Imap(
|
||||
"<C-J>",
|
||||
"copilot#Accept(<Tab>)",
|
||||
{ noremap = true, silent = true, expr = true }
|
||||
)
|
||||
vim.g.copilot_no_tab_map = true
|
||||
end,
|
||||
})
|
||||
|
||||
use({
|
||||
"simrat39/rust-tools.nvim",
|
||||
config = function()
|
||||
require("rust-tools").setup({})
|
||||
end,
|
||||
})
|
||||
use("b0o/schemastore.nvim")
|
||||
--
|
||||
use({
|
||||
"folke/trouble.nvim",
|
||||
config = function()
|
||||
require("trouble").setup({})
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"glepnir/lspsaga.nvim",
|
||||
config = function()
|
||||
require("config/lspsaga")
|
||||
end,
|
||||
})
|
||||
--
|
||||
use({
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
Imap("<C-J>", "copilot#Accept(<Tab>)", { noremap = true, silent = true, expr = true })
|
||||
vim.g.copilot_no_tab_map = true
|
||||
end,
|
||||
})
|
||||
-- organization
|
||||
use({
|
||||
"vimwiki/vimwiki",
|
||||
branch = "dev",
|
||||
config = function()
|
||||
vim.g.vimwiki_global_ext = 0
|
||||
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,
|
||||
})
|
||||
|
||||
-- organization
|
||||
use({
|
||||
"vimwiki/vimwiki",
|
||||
branch = "dev",
|
||||
config = function()
|
||||
vim.g.vimwiki_global_ext = 0
|
||||
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
|
||||
use({
|
||||
"glepnir/dashboard-nvim",
|
||||
config = function()
|
||||
require("config/dashboard")
|
||||
end,
|
||||
})
|
||||
|
||||
-- startup
|
||||
use({
|
||||
"glepnir/dashboard-nvim",
|
||||
config = function()
|
||||
require("config/dashboard")
|
||||
end,
|
||||
})
|
||||
|
||||
-- automatic theme switching
|
||||
use({
|
||||
"f-person/auto-dark-mode.nvim",
|
||||
config = function()
|
||||
local auto_dark_mode = require("auto-dark-mode")
|
||||
auto_dark_mode.setup({
|
||||
---@diagnostic disable-next-line: assign-type-mismatch
|
||||
update_interval = 1000,
|
||||
set_dark_mode = function()
|
||||
vim.cmd("Catppuccin frappe")
|
||||
end,
|
||||
set_light_mode = function()
|
||||
vim.cmd("Catppuccin latte")
|
||||
end,
|
||||
})
|
||||
auto_dark_mode.init()
|
||||
end,
|
||||
cond = vim.fn.has("macunix"),
|
||||
})
|
||||
-- automatic theme switching
|
||||
if vim.fn.has("macunix") then
|
||||
use({
|
||||
"f-person/auto-dark-mode.nvim",
|
||||
config = function()
|
||||
local auto_dark_mode = require("auto-dark-mode")
|
||||
auto_dark_mode.setup({
|
||||
---@diagnostic disable-next-line: assign-type-mismatch
|
||||
update_interval = 1000,
|
||||
set_dark_mode = function()
|
||||
vim.cmd("Catppuccin frappe")
|
||||
end,
|
||||
set_light_mode = function()
|
||||
vim.cmd("Catppuccin latte")
|
||||
end,
|
||||
})
|
||||
auto_dark_mode.init()
|
||||
end,
|
||||
})
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
local function map(mode, shortcut, command, opt)
|
||||
vim.keymap.set(mode, shortcut, command, opt)
|
||||
vim.keymap.set(mode, shortcut, command, opt)
|
||||
end
|
||||
|
||||
function Nmap(shortcut, command, opt)
|
||||
opt = opt or { noremap = true, silent = true }
|
||||
map("n", shortcut, command, opt)
|
||||
opt = opt or { noremap = true, silent = true }
|
||||
map("n", shortcut, command, opt)
|
||||
end
|
||||
|
||||
function Imap(shortcut, command, opt)
|
||||
opt = opt or { noremap = true, silent = true }
|
||||
map("i", shortcut, command, opt)
|
||||
opt = opt or { noremap = true, silent = true }
|
||||
map("i", shortcut, command, opt)
|
||||
end
|
||||
|
||||
function Xmap(shortcut, command, opt)
|
||||
opt = opt or { noremap = true, silent = true }
|
||||
map("x", shortcut, command, opt)
|
||||
opt = opt or { noremap = true, silent = true }
|
||||
map("x", shortcut, command, opt)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue