feat: zako
This commit is contained in:
26
lua/config/keymaps.lua
Normal file
26
lua/config/keymaps.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
-- LSP keymaps
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Go to definition
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
|
||||
-- Go to declaration
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
|
||||
-- Find references
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||
|
||||
-- Go to implementation
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||
|
||||
-- Hover documentation
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
|
||||
-- Signature help
|
||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
|
||||
|
||||
-- Rename symbol
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
|
||||
-- Code actions
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
35
lua/config/lazy.lua
Normal file
35
lua/config/lazy.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true, notify = false },
|
||||
})
|
||||
60
lua/plugins/blink-cmp.lua
Normal file
60
lua/plugins/blink-cmp.lua
Normal file
@@ -0,0 +1,60 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'enter' },
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = {
|
||||
documentation = { auto_show = true, auto_show_delay_ms = 500, },
|
||||
menu = { auto_show = true },
|
||||
ghost_text = { show_with_menu = false },
|
||||
list = {
|
||||
selection = { preselect = false }
|
||||
},
|
||||
},
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
||||
46
lua/plugins/blink-pairs.lua
Normal file
46
lua/plugins/blink-pairs.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
return {
|
||||
'saghen/blink.pairs',
|
||||
version = '*', -- (recommended) only required with prebuilt binaries
|
||||
|
||||
-- download prebuilt binaries from github releases
|
||||
dependencies = 'saghen/blink.download',
|
||||
-- OR build from source, requires nightly:
|
||||
-- https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
--- @module 'blink.pairs'
|
||||
--- @type blink.pairs.Config
|
||||
opts = {
|
||||
mappings = {
|
||||
-- you can call require("blink.pairs.mappings").enable()
|
||||
-- and require("blink.pairs.mappings").disable()
|
||||
-- to enable/disable mappings at runtime
|
||||
enabled = true,
|
||||
-- or disable with `vim.g.pairs = false` (global) and `vim.b.pairs = false` (per-buffer)
|
||||
-- and/or with `vim.g.blink_pairs = false` and `vim.b.blink_pairs = false`
|
||||
disabled_filetypes = {},
|
||||
-- see the defaults:
|
||||
-- https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L14
|
||||
pairs = {},
|
||||
},
|
||||
highlights = {
|
||||
enabled = true,
|
||||
-- requires require('vim._extui').enable({}), otherwise has no effect
|
||||
groups = {
|
||||
'BlinkPairsOrange',
|
||||
'BlinkPairsPurple',
|
||||
'BlinkPairsBlue',
|
||||
},
|
||||
|
||||
-- highlights matching pairs under the cursor
|
||||
matchparen = {
|
||||
enabled = true,
|
||||
-- known issue where typing won't update matchparen highlight, disabled by default
|
||||
group = 'BlinkPairsMatchParen',
|
||||
},
|
||||
},
|
||||
debug = false,
|
||||
}
|
||||
}
|
||||
36
lua/plugins/blink.lua
Normal file
36
lua/plugins/blink.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
return {
|
||||
'saghen/blink.nvim',
|
||||
build = 'cargo build --release', -- for delimiters
|
||||
keys = {
|
||||
-- chartoggle
|
||||
{
|
||||
'<C-;>',
|
||||
function()
|
||||
require('blink.chartoggle').toggle_char_eol(';')
|
||||
end,
|
||||
mode = { 'n', 'v' },
|
||||
desc = 'Toggle ; at eol',
|
||||
},
|
||||
{
|
||||
',',
|
||||
function()
|
||||
require('blink.chartoggle').toggle_char_eol(',')
|
||||
end,
|
||||
mode = { 'n', 'v' },
|
||||
desc = 'Toggle , at eol',
|
||||
},
|
||||
|
||||
-- tree
|
||||
{ '<C-e>', '<cmd>BlinkTree reveal<cr>', desc = 'Reveal current file in tree' },
|
||||
{ '<leader>E', '<cmd>BlinkTree toggle<cr>', desc = 'Reveal current file in tree' },
|
||||
{ '<leader>e', '<cmd>BlinkTree toggle-focus<cr>', desc = 'Toggle file tree focus' },
|
||||
},
|
||||
-- all modules handle lazy loading internally
|
||||
lazy = false,
|
||||
opts = {
|
||||
chartoggle = { enabled = true },
|
||||
tree = { enabled = true },
|
||||
cmp = { enabled = true },
|
||||
pairs = { enabled = true },
|
||||
}
|
||||
}
|
||||
27
lua/plugins/bufferline.lua
Normal file
27
lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle Pin" },
|
||||
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete Non-Pinned Buffers" },
|
||||
{ "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete Buffers to the Right" },
|
||||
{ "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete Buffers to the Left" },
|
||||
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
|
||||
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
||||
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
|
||||
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
||||
{ "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" },
|
||||
{ "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" },
|
||||
},
|
||||
config = function()
|
||||
require("bufferline").setup{}
|
||||
-- Fix bufferline when restoring a session
|
||||
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
pcall(nvim_bufferline)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
8
lua/plugins/fzf-lua.lua
Normal file
8
lua/plugins/fzf-lua.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"ibhagwan/fzf-lua",
|
||||
-- optional for icon support
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
-- or if using mini.icons/mini.nvim
|
||||
-- dependencies = { "echasnovski/mini.icons" },
|
||||
opts = {}
|
||||
}
|
||||
53
lua/plugins/gitsigns.lua
Normal file
53
lua/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged_enable = true,
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
auto_attach = true,
|
||||
attach_to_untracked = false,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
virt_text_priority = 100,
|
||||
use_focus = true,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
}
|
||||
}
|
||||
7
lua/plugins/highlight-colors.lua
Normal file
7
lua/plugins/highlight-colors.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'brenoprata10/nvim-highlight-colors',
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('nvim-highlight-colors').setup{}
|
||||
end
|
||||
}
|
||||
5
lua/plugins/init.lua
Normal file
5
lua/plugins/init.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"folke/neodev.nvim",
|
||||
"folke/which-key.nvim",
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf" },
|
||||
}
|
||||
22
lua/plugins/lsp-lens.lua
Normal file
22
lua/plugins/lsp-lens.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
local SymbolKind = vim.lsp.protocol.SymbolKind
|
||||
|
||||
return {
|
||||
'VidocqH/lsp-lens.nvim',
|
||||
opts = {
|
||||
enable = true,
|
||||
include_declaration = false, -- Reference include declaration
|
||||
sections = { -- Enable / Disable specific request, formatter example looks 'Format Requests'
|
||||
definition = false,
|
||||
references = true,
|
||||
implements = true,
|
||||
git_authors = true,
|
||||
},
|
||||
ignore_filetype = {
|
||||
"prisma",
|
||||
},
|
||||
-- Target Symbol Kinds to show lens information
|
||||
target_symbol_kinds = { SymbolKind.Function, SymbolKind.Method, SymbolKind.Interface },
|
||||
-- Symbol Kinds that may have target symbol kinds as children
|
||||
wrapper_symbol_kinds = { SymbolKind.Class, SymbolKind.Struct },
|
||||
}
|
||||
}
|
||||
32
lua/plugins/lspconfig.lua
Normal file
32
lua/plugins/lspconfig.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = { 'saghen/blink.cmp' },
|
||||
|
||||
lazy = false,
|
||||
|
||||
-- example using `opts` for defining servers
|
||||
opts = {
|
||||
inlay_hints = { enabled = true },
|
||||
servers = {
|
||||
lua_ls = {}
|
||||
}
|
||||
},
|
||||
config = function(_, opts)
|
||||
local lspconfig = require('lspconfig')
|
||||
for server, config in pairs(opts.servers) do
|
||||
-- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- `opts[server].capabilities, if you've defined it
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
-- example calling setup directly for each LSP
|
||||
config = function()
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
lspconfig['lua_ls'].setup({ capabilities = capabilities })
|
||||
end
|
||||
}
|
||||
7
lua/plugins/lualine.lua
Normal file
7
lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
opts = {
|
||||
options = { theme = "16color" }
|
||||
},
|
||||
}
|
||||
11
lua/plugins/mason-lspconfig.lua
Normal file
11
lua/plugins/mason-lspconfig.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = { "lua_ls", "rust_analyzer", "ts_ls" },
|
||||
},
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
}
|
||||
5
lua/plugins/mason.lua
Normal file
5
lua/plugins/mason.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"mason-org/mason.nvim",
|
||||
lazy = false,
|
||||
opts = {}
|
||||
}
|
||||
23
lua/plugins/snacks.lua
Normal file
23
lua/plugins/snacks.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
bigfile = { enabled = true },
|
||||
dashboard = { enabled = true },
|
||||
explorer = { enabled = true },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
}
|
||||
11
lua/plugins/toggleterm.lua
Normal file
11
lua/plugins/toggleterm.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return
|
||||
{
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = "*",
|
||||
config = true,
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<leader>th", "<Cmd>ToggleTerm<CR>", desc = "ToggleTerm Horizontal" },
|
||||
{ "<leader>tv", "<Cmd>ToggleTerm<CR>", desc = "ToggleTerm Vertical" }
|
||||
}
|
||||
}
|
||||
6
lua/plugins/treesitter.lua
Normal file
6
lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
branch = 'main',
|
||||
build = ':TSUpdate'
|
||||
}
|
||||
37
lua/plugins/trouble.lua
Normal file
37
lua/plugins/trouble.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
opts = {}, -- for default options, refer to the configuration section for custom setup.
|
||||
cmd = "Trouble",
|
||||
keys = {
|
||||
{
|
||||
"<leader>xx",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
desc = "Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xX",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||
desc = "Buffer Diagnostics (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cs",
|
||||
"<cmd>Trouble symbols toggle focus=false<cr>",
|
||||
desc = "Symbols (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>cl",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP Definitions / references / ... (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xL",
|
||||
"<cmd>Trouble loclist toggle<cr>",
|
||||
desc = "Location List (Trouble)",
|
||||
},
|
||||
{
|
||||
"<leader>xQ",
|
||||
"<cmd>Trouble qflist toggle<cr>",
|
||||
desc = "Quickfix List (Trouble)",
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user