Formatted all files and added stylua workflow
This commit is contained in:
parent
18f268a915
commit
c3eddee629
15 changed files with 503 additions and 364 deletions
35
.github/workflows/format.yml
vendored
Normal file
35
.github/workflows/format.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
name: stylua
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
tags: ["v*.*.*"]
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
branches: ["*"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
format:
|
||||
runs-on: [self-hosted]
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Activate nix-shell
|
||||
uses: nicknovitski/nix-develop@v1.2.0
|
||||
with:
|
||||
arguments: "github:C4theBomb/nixos-config#lua-dev"
|
||||
- name: Format all files
|
||||
run: stylua .
|
||||
- name: Commit changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5.0.1
|
||||
with:
|
||||
commit_message: |
|
||||
Autoformatting with stylua
|
||||
|
||||
[skip ci]
|
||||
|
||||
|
|
@ -1,33 +1,35 @@
|
|||
require "nvchad.autocmds"
|
||||
require("nvchad.autocmds")
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd({ "TextYankPost" }, {
|
||||
group = vim.api.nvim_create_augroup("HighlightYank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank({
|
||||
higroup = "IncSearch",
|
||||
timeout = 40,
|
||||
})
|
||||
end
|
||||
group = vim.api.nvim_create_augroup("HighlightYank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank({
|
||||
higroup = "IncSearch",
|
||||
timeout = 40,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd({ "BufWinEnter" }, {
|
||||
group = vim.api.nvim_create_augroup("Fugitive", {}),
|
||||
callback = function()
|
||||
if vim.bo.ft ~= 'fugitive' then
|
||||
return
|
||||
end
|
||||
group = vim.api.nvim_create_augroup("Fugitive", {}),
|
||||
callback = function()
|
||||
if vim.bo.ft ~= "fugitive" then
|
||||
return
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>p', '<cmd>Git pull<CR>', { desc = "Fugitive Git pull" })
|
||||
vim.keymap.set('n', '<leader>P', '<cmd>Git push<CR>', { desc = "Fugitive Git push" })
|
||||
end
|
||||
vim.keymap.set("n", "<leader>p", "<cmd>Git pull<CR>", { desc = "Fugitive Git pull" })
|
||||
vim.keymap.set("n", "<leader>P", "<cmd>Git push<CR>", { desc = "Fugitive Git push" })
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd({ "LspAttach" }, {
|
||||
group = vim.api.nvim_create_augroup("Lsp", {}),
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf, }
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
end
|
||||
group = vim.api.nvim_create_augroup("Lsp", {}),
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf }
|
||||
vim.keymap.set("n", "K", function()
|
||||
vim.lsp.buf.hover()
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,22 +2,22 @@
|
|||
local M = {}
|
||||
|
||||
M.ui = {
|
||||
theme = "tokyonight",
|
||||
tabufline = {
|
||||
enabled = false,
|
||||
},
|
||||
theme = "tokyonight",
|
||||
tabufline = {
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
|
||||
M.copilot = {
|
||||
i = {
|
||||
["<C-l>"] = {
|
||||
function()
|
||||
vim.fn.feedkeys(vim.fn['copilot#Accept'](), '')
|
||||
end,
|
||||
"Copilot Accept",
|
||||
{ replace_keycodes = true, nowait = true, silent = true, expr = true, noremap = true }
|
||||
}
|
||||
}
|
||||
i = {
|
||||
["<C-l>"] = {
|
||||
function()
|
||||
vim.fn.feedkeys(vim.fn["copilot#Accept"](), "")
|
||||
end,
|
||||
"Copilot Accept",
|
||||
{ replace_keycodes = true, nowait = true, silent = true, expr = true, noremap = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
local options = {
|
||||
suggestion = {
|
||||
enable = false,
|
||||
},
|
||||
panel = {
|
||||
enable = false,
|
||||
},
|
||||
suggestion = {
|
||||
enable = false,
|
||||
},
|
||||
panel = {
|
||||
enable = false,
|
||||
},
|
||||
}
|
||||
|
||||
require('copilot').setup(options)
|
||||
require("copilot").setup(options)
|
||||
|
|
|
|||
|
|
@ -3,13 +3,33 @@ local set = vim.keymap.set
|
|||
|
||||
harpoon:setup()
|
||||
|
||||
set("n", "<leader>a", function() harpoon:list():add() end, { desc = "Harpoon Add new entry" })
|
||||
set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Harpoon Open quick menu" })
|
||||
set("n", "<C-j>", function() harpoon:list():select(1) end, { desc = "Harpoon Select entry 1" })
|
||||
set("n", "<C-k>", function() harpoon:list():select(2) end, { desc = "Harpoon Select entry 2" })
|
||||
set("n", "<C-l>", function() harpoon:list():select(3) end, { desc = "Harpoon Select entry 3" })
|
||||
set("n", "<C-;>", function() harpoon:list():select(4) end, { desc = "Harpoon Select entry 4" })
|
||||
set("n", "<leader><C-j>", function() harpoon:list():replace_at(1) end, { desc = "Harpoon Replace entry 1" })
|
||||
set("n", "<leader><C-k>", function() harpoon:list():replace_at(2) end, { desc = "Harpoon Replace entry 2" })
|
||||
set("n", "<leader><C-l>", function() harpoon:list():replace_at(3) end, { desc = "Harpoon Replace entry 3" })
|
||||
set("n", "<leader><C-;>", function() harpoon:list():replace_at(4) end, { desc = "Harpoon Replace entry 4" })
|
||||
set("n", "<leader>a", function()
|
||||
harpoon:list():add()
|
||||
end, { desc = "Harpoon Add new entry" })
|
||||
set("n", "<C-e>", function()
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end, { desc = "Harpoon Open quick menu" })
|
||||
set("n", "<C-j>", function()
|
||||
harpoon:list():select(1)
|
||||
end, { desc = "Harpoon Select entry 1" })
|
||||
set("n", "<C-k>", function()
|
||||
harpoon:list():select(2)
|
||||
end, { desc = "Harpoon Select entry 2" })
|
||||
set("n", "<C-l>", function()
|
||||
harpoon:list():select(3)
|
||||
end, { desc = "Harpoon Select entry 3" })
|
||||
set("n", "<C-;>", function()
|
||||
harpoon:list():select(4)
|
||||
end, { desc = "Harpoon Select entry 4" })
|
||||
set("n", "<leader><C-j>", function()
|
||||
harpoon:list():replace_at(1)
|
||||
end, { desc = "Harpoon Replace entry 1" })
|
||||
set("n", "<leader><C-k>", function()
|
||||
harpoon:list():replace_at(2)
|
||||
end, { desc = "Harpoon Replace entry 2" })
|
||||
set("n", "<leader><C-l>", function()
|
||||
harpoon:list():replace_at(3)
|
||||
end, { desc = "Harpoon Replace entry 3" })
|
||||
set("n", "<leader><C-;>", function()
|
||||
harpoon:list():replace_at(4)
|
||||
end, { desc = "Harpoon Replace entry 4" })
|
||||
|
|
|
|||
|
|
@ -1,47 +1,47 @@
|
|||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,47 +3,47 @@ local on_init = require("nvchad.configs.lspconfig").on_init
|
|||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "html", "cssls" },
|
||||
handlers = {
|
||||
function(server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
}
|
||||
end,
|
||||
zls = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.zls.setup({
|
||||
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
|
||||
settings = {
|
||||
zls = {
|
||||
enable_inlay_hints = true,
|
||||
enable_snippets = true,
|
||||
warn_style = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.g.zig_fmt_parse_errors = 0
|
||||
vim.g.zig_fmt_autosave = 0
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
ensure_installed = { "lua_ls", "html", "cssls" },
|
||||
handlers = {
|
||||
function(server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
})
|
||||
end,
|
||||
zls = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.zls.setup({
|
||||
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
|
||||
settings = {
|
||||
zls = {
|
||||
enable_inlay_hints = true,
|
||||
enable_snippets = true,
|
||||
warn_style = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.g.zig_fmt_parse_errors = 0
|
||||
vim.g.zig_fmt_autosave = 0
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
require('lspconfig').clangd.setup({
|
||||
capabilities = capabilities,
|
||||
require("lspconfig").clangd.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,67 +1,77 @@
|
|||
local dap, dapui = require("dap"), require("dapui")
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
dapui.open()
|
||||
end
|
||||
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
dapui.open()
|
||||
end
|
||||
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
set('n', '<leader>db', function() dap.toggle_breakpoint() end, { desc = 'Debug Toggle breakpoint' });
|
||||
set('n', '<leader>dc', function() dap.continue() end, { desc = 'Debug Continue' });
|
||||
set('n', '<leader>do', function() dap.step_over() end, { desc = 'Debug Step over' });
|
||||
set('n', '<leader>di', function() dap.step_out() end, { desc = 'Debug Step into' });
|
||||
set('n', '<leader>dr', function() dap.repl.open() end, { desc = 'Debug Toggle repl' });
|
||||
set("n", "<leader>db", function()
|
||||
dap.toggle_breakpoint()
|
||||
end, { desc = "Debug Toggle breakpoint" })
|
||||
set("n", "<leader>dc", function()
|
||||
dap.continue()
|
||||
end, { desc = "Debug Continue" })
|
||||
set("n", "<leader>do", function()
|
||||
dap.step_over()
|
||||
end, { desc = "Debug Step over" })
|
||||
set("n", "<leader>di", function()
|
||||
dap.step_out()
|
||||
end, { desc = "Debug Step into" })
|
||||
set("n", "<leader>dr", function()
|
||||
dap.repl.open()
|
||||
end, { desc = "Debug Toggle repl" })
|
||||
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "--interpreter=dap", "--eval-command", "set print pretty on" },
|
||||
}
|
||||
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false,
|
||||
},
|
||||
{
|
||||
name = "Select and attach to process",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
pid = function()
|
||||
local name = vim.fn.input('Executable name (filter): ')
|
||||
return require("dap.utils").pick_process({ filter = name })
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
{
|
||||
name = 'Attach to gdbserver :1234',
|
||||
type = 'gdb',
|
||||
request = 'attach',
|
||||
target = 'localhost:1234',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false,
|
||||
},
|
||||
{
|
||||
name = "Select and attach to process",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
pid = function()
|
||||
local name = vim.fn.input("Executable name (filter): ")
|
||||
return require("dap.utils").pick_process({ filter = name })
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
name = "Attach to gdbserver :1234",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
target = "localhost:1234",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,83 +1,83 @@
|
|||
local options = {
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_ignored = true,
|
||||
custom = { ".git", "__pycache__" },
|
||||
exclude = { ".gitignore", ".gitattributes", ".gitmodules", ".github" },
|
||||
},
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
hijack_cursor = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
sync_root_with_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
},
|
||||
view = {
|
||||
side = "right",
|
||||
width = 60,
|
||||
number = true,
|
||||
adaptive_size = false,
|
||||
preserve_window_proportions = true,
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
},
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
filesystem_watchers = {
|
||||
enable = true,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
resize_window = true,
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
root_folder_label = false,
|
||||
group_empty = true,
|
||||
indent_width = 2,
|
||||
highlight_git = true,
|
||||
highlight_opened_files = "none",
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_ignored = true,
|
||||
custom = { ".git", "__pycache__" },
|
||||
exclude = { ".gitignore", ".gitattributes", ".gitmodules", ".github" },
|
||||
},
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
hijack_cursor = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
sync_root_with_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
},
|
||||
view = {
|
||||
side = "right",
|
||||
width = 60,
|
||||
number = true,
|
||||
adaptive_size = false,
|
||||
preserve_window_proportions = true,
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
},
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
filesystem_watchers = {
|
||||
enable = true,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
resize_window = true,
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
root_folder_label = false,
|
||||
group_empty = true,
|
||||
indent_width = 2,
|
||||
highlight_git = true,
|
||||
highlight_opened_files = "none",
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
default = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
arrow_open = "",
|
||||
arrow_closed = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
default = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
arrow_open = "",
|
||||
arrow_closed = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("nvim-tree").setup(options)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
require("ufo").setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return { 'treesitter', 'indent' }
|
||||
end
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return { "treesitter", "indent" }
|
||||
end,
|
||||
})
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
local set = vim.keymap.set
|
||||
|
||||
set("n", "<leader>zz", function()
|
||||
require("zen-mode").setup({
|
||||
window = {
|
||||
width = 150,
|
||||
options = {}
|
||||
},
|
||||
})
|
||||
require("zen-mode").toggle()
|
||||
require("zen-mode").setup({
|
||||
window = {
|
||||
width = 150,
|
||||
options = {},
|
||||
},
|
||||
})
|
||||
require("zen-mode").toggle()
|
||||
|
||||
vim.wo.wrap = false
|
||||
vim.wo.number = true
|
||||
vim.wo.rnu = true
|
||||
vim.wo.wrap = false
|
||||
vim.wo.number = true
|
||||
vim.wo.rnu = true
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -7,24 +7,36 @@ map("n", "<leader>ch", "<cmd>NvCheatsheet<CR>", { desc = "General Toggle nvcheat
|
|||
|
||||
-- File
|
||||
map("n", "<C-s>", "<cmd>w<CR>", { desc = "File Save" })
|
||||
map("n", "<leader>f", function() require("conform").format({ lsp_fallback = true }) end, { desc = "File Format" })
|
||||
map("n", "<leader>f", function()
|
||||
require("conform").format({ lsp_fallback = true })
|
||||
end, { desc = "File Format" })
|
||||
|
||||
-- Buffer
|
||||
map("n", "<leader>b", "<cmd>enew<CR>", { desc = "Buffer new" })
|
||||
map("n", "<tab>", function() require("nvchad.tabufline").next() end, { desc = "Buffer goto next" })
|
||||
map("n", "<S-tab>", function() require("nvchad.tabufline").prev() end, { desc = "Buffer goto prev" })
|
||||
map("n", "<leader>x", function() require("nvchad.tabufline").close_buffer() end, { desc = "Buffer Close" })
|
||||
map("n", "<tab>", function()
|
||||
require("nvchad.tabufline").next()
|
||||
end, { desc = "Buffer goto next" })
|
||||
map("n", "<S-tab>", function()
|
||||
require("nvchad.tabufline").prev()
|
||||
end, { desc = "Buffer goto prev" })
|
||||
map("n", "<leader>x", function()
|
||||
require("nvchad.tabufline").close_buffer()
|
||||
end, { desc = "Buffer Close" })
|
||||
|
||||
-- nvimtree
|
||||
map("n", "<leader>pv", "<cmd>NvimTreeToggle<CR>", { desc = "nvimtree toggle window" })
|
||||
|
||||
-- Terminal
|
||||
map("t", "<C-x>", "<C-\\><C-N>", { desc = "Terminal Escape terminal mode" })
|
||||
map("n", "<leader>h", function() require("nvchad.term").new { pos = "sp" } end, { desc = "Terminal New horizontal term" })
|
||||
map({ "n", "t" }, "<A-h>", function() require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" } end,
|
||||
{ desc = "Terminal New horizontal term" })
|
||||
map({ "n", "t" }, "<A-i>", function() require("nvchad.term").toggle { pos = "float", id = "floatTerm" } end,
|
||||
{ desc = "Terminal Toggle floating term" })
|
||||
map("n", "<leader>h", function()
|
||||
require("nvchad.term").new({ pos = "sp" })
|
||||
end, { desc = "Terminal New horizontal term" })
|
||||
map({ "n", "t" }, "<A-h>", function()
|
||||
require("nvchad.term").toggle({ pos = "sp", id = "htoggleTerm" })
|
||||
end, { desc = "Terminal New horizontal term" })
|
||||
map({ "n", "t" }, "<A-i>", function()
|
||||
require("nvchad.term").toggle({ pos = "float", id = "floatTerm" })
|
||||
end, { desc = "Terminal Toggle floating term" })
|
||||
|
||||
-- Vertical
|
||||
map("n", "<C-d>", "<C-d>zz", { desc = "Vertical Scroll down and keep cursor in same position" })
|
||||
|
|
@ -33,8 +45,12 @@ map("n", "<C-u>", "<C-u>zz", { desc = "Vertical Scroll up and keep cursor in sam
|
|||
-- Find/Replace
|
||||
map("n", "n", "nzzzv", { desc = "Find/Replace Move to next match" })
|
||||
map("n", "N", "Nzzzv", { desc = "Find/Replace Move to previous match" })
|
||||
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
|
||||
{ desc = "Find/Replace Replace current word" })
|
||||
map(
|
||||
"n",
|
||||
"<leader>s",
|
||||
[[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
|
||||
{ desc = "Find/Replace Replace current word" }
|
||||
)
|
||||
|
||||
-- Editing
|
||||
map("v", "J", ":m '>+1<CR>gv=gv", { desc = "Editing Move line down" })
|
||||
|
|
@ -52,20 +68,24 @@ map("n", "<leader>j", "<cmd>lprev<CR>zz", { desc = "Navigation Move to previous
|
|||
|
||||
-- Telescope
|
||||
map("n", "<leader>pf", "<cmd>Telescope find_files<CR>", { desc = "Telescope Find files" })
|
||||
map("n", "<leader>pa", "<cmd>Telescope find_files follow=true no_ignore=true hidden=true<CR>",
|
||||
{ desc = "Telescope Find all files" })
|
||||
map(
|
||||
"n",
|
||||
"<leader>pa",
|
||||
"<cmd>Telescope find_files follow=true no_ignore=true hidden=true<CR>",
|
||||
{ desc = "Telescope Find all files" }
|
||||
)
|
||||
map("n", "<leader>ps", "<cmd>Telescope live_grep<CR>", { desc = "Telescope Live grep" })
|
||||
map("n", "<leader>pz", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "Telescope Find in current buffer" })
|
||||
map("n", "<leader>pws", function()
|
||||
local word = vim.fn.expand("<cword>")
|
||||
require('telescope.builtin').grep_string({ search = word })
|
||||
local word = vim.fn.expand("<cword>")
|
||||
require("telescope.builtin").grep_string({ search = word })
|
||||
end, { desc = "Telescope Search for current word" })
|
||||
map("n", "<leader>pWs", function()
|
||||
local word = vim.fn.expand("<cWORD>")
|
||||
require('telescope.builtin').grep_string({ search = word })
|
||||
local word = vim.fn.expand("<cWORD>")
|
||||
require("telescope.builtin").grep_string({ search = word })
|
||||
end, { desc = "Telescope Search for current WORD" })
|
||||
map("n", "ws", function()
|
||||
require('telescope.builtin').lsp_document_symbols({ ignore_symbols = 'variable' })
|
||||
require("telescope.builtin").lsp_document_symbols({ ignore_symbols = "variable" })
|
||||
end, { desc = "Telescope View workspace symbols" })
|
||||
|
||||
-- Undotree
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
require "nvchad.options"
|
||||
require("nvchad.options")
|
||||
|
||||
local o = vim.o
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
g.mapleader = ' '
|
||||
g.maplocalleader = ' '
|
||||
g.mapleader = " "
|
||||
g.maplocalleader = " "
|
||||
|
||||
opt.nu = true
|
||||
opt.relativenumber = true
|
||||
|
|
@ -29,7 +29,7 @@ opt.termguicolors = true
|
|||
opt.scrolloff = 8
|
||||
opt.isfname:append("@-@")
|
||||
|
||||
o.foldcolumn = '0'
|
||||
o.foldcolumn = "0"
|
||||
o.foldlevel = 99
|
||||
o.foldlevelstart = 99
|
||||
o.foldenable = true
|
||||
|
|
|
|||
|
|
@ -1,63 +1,115 @@
|
|||
return {
|
||||
{ "sitiom/nvim-numbertoggle", lazy = false, },
|
||||
{ "junegunn/gv.vim", cmd = { "GV" } },
|
||||
{ "mbbill/undotree", cmd = { "UndotreeToggle" } },
|
||||
{ "folke/trouble.nvim", cmd = { "Trouble" }, opts = {} },
|
||||
{ "zbirenbaum/copilot.lua", event = "InsertEnter", config = function() require("configs.copilot") end },
|
||||
{ "nvim-tree/nvim-tree.lua", cmd = { "NvimTreeToggle", "NvimTreeFocus" }, config = function() require("configs.nvimtree") end },
|
||||
{ "folke/zen-mode.nvim", keys = { "<leader>zz" }, config = function() require("configs.zenmode") end },
|
||||
{ "stevearc/conform.nvim", config = function() require("configs.conform") end },
|
||||
{ "mfussenegger/nvim-dap", lazy = false, },
|
||||
{ "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, config = function() require("configs.nvim-dap") end, lazy = false },
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { { "zbirenbaum/copilot-cmp", config = function() require("copilot_cmp").setup() end, }, },
|
||||
opts = {
|
||||
sources = {
|
||||
{ name = "nvim_lsp", group_index = 2 },
|
||||
{ name = "copilot", group_index = 2 },
|
||||
{ name = "luasnip", group_index = 2 },
|
||||
{ name = "buffer", group_index = 2 },
|
||||
{ name = "nvim_lua", group_index = 2 },
|
||||
{ name = "path", group_index = 2 },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "kylechui/nvim-surround", event = "VeryLazy", opts = {} },
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
keys = {
|
||||
{ "<leader>gs", "<cmd>Git<CR>", desc = "Git Toggle window" },
|
||||
{ "gu", "<cmd>diffget //2<CR>", desc = "Git Diff right side" },
|
||||
{ "gh", "<cmd>diffget //3<CR>", desc = "Git Diff left side" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function() vim.g.mkdp_filetypes = { "markdown" } end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim" },
|
||||
config = function()
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
require("configs.lspconfig")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = { "<leader>a", "<C-e>", "<C-j>", "<C-k>", "<C-l>", "<C-;>", "<leader><C-j>", "<leader><C-k>", "<leader><C-l>", "<leader><C-;>" },
|
||||
config = function() require("configs.harpoon") end,
|
||||
},
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
lazy = false,
|
||||
dependencies = { "kevinhwang91/promise-async" },
|
||||
config = function() require("configs.ufo") end,
|
||||
},
|
||||
{ "sitiom/nvim-numbertoggle", lazy = false },
|
||||
{ "junegunn/gv.vim", cmd = { "GV" } },
|
||||
{ "mbbill/undotree", cmd = { "UndotreeToggle" } },
|
||||
{ "folke/trouble.nvim", cmd = { "Trouble" }, opts = {} },
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("configs.copilot")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||
config = function()
|
||||
require("configs.nvimtree")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
keys = { "<leader>zz" },
|
||||
config = function()
|
||||
require("configs.zenmode")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require("configs.conform")
|
||||
end,
|
||||
},
|
||||
{ "mfussenegger/nvim-dap", lazy = false },
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||
config = function()
|
||||
require("configs.nvim-dap")
|
||||
end,
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { {
|
||||
"zbirenbaum/copilot-cmp",
|
||||
config = function()
|
||||
require("copilot_cmp").setup()
|
||||
end,
|
||||
} },
|
||||
opts = {
|
||||
sources = {
|
||||
{ name = "nvim_lsp", group_index = 2 },
|
||||
{ name = "copilot", group_index = 2 },
|
||||
{ name = "luasnip", group_index = 2 },
|
||||
{ name = "buffer", group_index = 2 },
|
||||
{ name = "nvim_lua", group_index = 2 },
|
||||
{ name = "path", group_index = 2 },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "kylechui/nvim-surround", event = "VeryLazy", opts = {} },
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
keys = {
|
||||
{ "<leader>gs", "<cmd>Git<CR>", desc = "Git Toggle window" },
|
||||
{ "gu", "<cmd>diffget //2<CR>", desc = "Git Diff right side" },
|
||||
{ "gh", "<cmd>diffget //3<CR>", desc = "Git Diff left side" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim" },
|
||||
config = function()
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
require("configs.lspconfig")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = {
|
||||
"<leader>a",
|
||||
"<C-e>",
|
||||
"<C-j>",
|
||||
"<C-k>",
|
||||
"<C-l>",
|
||||
"<C-;>",
|
||||
"<leader><C-j>",
|
||||
"<leader><C-k>",
|
||||
"<leader><C-l>",
|
||||
"<leader><C-;>",
|
||||
},
|
||||
config = function()
|
||||
require("configs.harpoon")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
lazy = false,
|
||||
dependencies = { "kevinhwang91/promise-async" },
|
||||
config = function()
|
||||
require("configs.ufo")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue