refactor: simplify startup profiles and ignore local tooling configs

This commit is contained in:
2026-05-30 15:01:30 +08:00
parent 5cba0307a3
commit 94699474c7
36 changed files with 604 additions and 1166 deletions
+17 -3
View File
@@ -1,4 +1,18 @@
.vscode/
lazy-lock.json
lazyvim.json
baremetal
nvim-pack-lock.json
# Local formatter configuration (not tracked)
stylua.toml
.stylua.toml
# Local Neovim tooling configuration (not tracked)
.neoconf.json
# Neovim/Editor temporary files
*.swp
*.swo
*~
# OS metadata
.DS_Store
Thumbs.db
-15
View File
@@ -1,15 +0,0 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}
+65 -31
View File
@@ -1,34 +1,68 @@
# NvimConfig
## Configuration for VSCode-Neovim
This is a Neovim 0.12+ configuration with no dependency on lazy.nvim or LazyVim.
## Layout
```text
init.lua
lua/
profiles/
native.lua
vscode.lua
plugins/
pack.lua
native/
vscode/
```
## Startup Flow
- `init.lua` is the only entrypoint.
- If started from VSCode (`vim.g.vscode`), it loads `profiles.vscode`.
- Otherwise it loads `profiles.native`.
## Plugin Management
This config uses Neovim built-in `vim.pack` through `lua/plugins/pack.lua`.
- Plugin declarations live in `lua/profiles/*.lua`.
- Run `:lua vim.pack.update()` to update plugins.
- `nvim-pack-lock.json` is intentionally not tracked.
## Style Formatting
Lua formatting is configured in `.stylua.toml`.
This file is for formatting only; runtime/editor options stay in Lua code.
## VSCode Keybindings
### `<leader>` +
|L1 |L2 |L3 |Function |
|--- |--- |--- |--- |
|s (search) |s |- | Search Symbols with VSCode Ctrl-P@ |
|s |b |- | Search Breadcrumbs |
|s |e |- | Search Editors Cross-Groups |
|`<leader>` |e |- | Toggle Editor Inside Group |
|`<leader>` |E |- | Toggle Editor Cross-Groups |
|`<leader>` |g |- | Toggle Groups |
|`<leader>` |z |- | Toggle Zen Mode |
|`<leader>` |/ |- | Toggle Flash.nvim Search |
|b (side bar) |e |- | Open Sidebar Explorer |
|b |s |- | Open Sidebar Search |
|c (code) |f |- | Format Code |
|c |t |- | Flash.nvim Treesitter |
|e (editor) |d |- | Close Editor |
|e |g |- | Search Editor Cross-Groups |
|e |i |- | Search Editor Inside Group |
|e |h |- | Navigate Editors in Group: Previous |
|e |l |- | Navigate Editors in Group: Next |
|e |m |n | Move Editor to Next Group |
|e |m |p | Move Editor to Previous Group |
|g (group) |= |- | Equal Groups Sizes |
|g |d |- | Close Group but Remain Editors |
|g |D |- | Close Group and Editors |
|g |s |- | Split Group Horizontally |
|g |v |- | Split Group Vertically |
|s (search) |f |- | Search Files with VSCode Ctrl-P |
|s |s |- | Search Symbols with VSCode Ctrl-P@ |
|s |b |- | Search Breadcrumbs |
|s |e |- | Search Editors Cross-Groups |
| L1 | L2 | L3 | Function |
| --- | --- | --- | --- |
| `<leader>` | `e` | - | Toggle Editor Inside Group |
| `<leader>` | `E` | - | Toggle Editor Cross Groups |
| `<leader>` | `g` | - | Focus Next Group |
| `<leader>` | `z` | - | Toggle Zen Mode |
| `<leader>` | `/` | - | Toggle Flash Search |
| `b` | `e` | - | Open Sidebar Explorer |
| `b` | `s` | - | Open Sidebar Search |
| `c` | `f` | - | Format Code |
| `c` | `t` | - | Flash Treesitter |
| `e` | `d` | - | Close Editor |
| `e` | `g` | - | Search Editor Cross Groups |
| `e` | `i` | - | Search Editor Inside Group |
| `e` | `h` | - | Previous Editor In Group |
| `e` | `l` | - | Next Editor In Group |
| `e` | `m` | `n` | Move Editor To Next Group |
| `e` | `m` | `p` | Move Editor To Previous Group |
| `g` | `=` | - | Equal Group Size |
| `g` | `d` | - | Close Group, Keep Editors |
| `g` | `D` | - | Close Group And Editors |
| `g` | `s` | - | Split Group Horizontally |
| `g` | `v` | - | Split Group Vertically |
| `s` | `f` | - | Search Files |
| `s` | `s` | - | Search Symbols |
| `s` | `b` | - | Search Breadcrumbs |
| `s` | `e` | - | Search Editors Cross Groups |
+15 -19
View File
@@ -1,23 +1,19 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
vim.opt.clipboard = "unnamedplus"
vim.opt.incsearch = true
vim.opt.hlsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
if vim.g.vscode then
require('config.lazyvscode')
require("profiles.vscode").setup()
else
local info = debug.getinfo(1, "S")
local path_info = info.source:sub(2)
local path
if vim.loop.os_uname().sysname == "Windows_NT" then
-- Windows platform (backslashes or forward slashes)
path = path_info:match("(.*[/\\])")
else
-- Linux/macOS platform (forward slashes only)
path = path_info:match("(.*/)")
end
local file, err = io.open(string.format("%s%s", path, "/baremetal"), "r")
if file then
file:close()
require("config.lazybaremetal")
else
require("config.lazynvimide")
end
require("profiles.native").setup()
end
-17
View File
@@ -1,17 +0,0 @@
return{
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
modes = {search = {enabled = true}},
-- stylua: ignore
keys = {
{ "<leader>s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "<leader>S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
-- { "<leader>r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
-- { "<leader>R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
-- { "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}
}
-59
View File
@@ -1,59 +0,0 @@
return {
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
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 = true, -- 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
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
},
config = function(_, opts)
require('gitsigns').setup(opts)
end
}
}
-83
View File
@@ -1,83 +0,0 @@
return {
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
options = {
theme = "auto",
},
-- sections = {
-- lualine_c = {
-- -- 显示当前窗口编号(格式:[窗口号] 文件名)
-- function()
-- return "[" .. tostring(vim.api.nvim_win_get_number(0)) .. "] " .. vim.fn.expand("%:t")
-- end,
-- },
-- },
}
}
}
-- local colors = {
-- blue = '#80a0ff',
-- cyan = '#79dac8',
-- black = '#080808',
-- white = '#c6c6c6',
-- red = '#ff5189',
-- violet = '#d183e8',
-- grey = '#303030',
-- }
-- local bubbles_theme = {
-- normal = {
-- a = { fg = colors.black, bg = colors.violet },
-- b = { fg = colors.white, bg = colors.grey },
-- c = { fg = colors.white },
-- },
-- insert = { a = { fg = colors.black, bg = colors.blue } },
-- visual = { a = { fg = colors.black, bg = colors.cyan } },
-- replace = { a = { fg = colors.black, bg = colors.red } },
-- inactive = {
-- a = { fg = colors.white, bg = colors.black },
-- b = { fg = colors.white, bg = colors.black },
-- c = { fg = colors.white },
-- },
-- }
-- return {
-- {
-- 'nvim-lualine/lualine.nvim',
-- dependencies = { 'nvim-tree/nvim-web-devicons' },
-- opts = {
-- options = {
-- theme = bubbles_theme,
-- component_separators = '',
-- section_separators = { left = '', right = '' },
-- },
-- },
-- sections = {
-- lualine_a = { { 'mode', separator = { left = '' }, right_padding = 2 } },
-- lualine_b = { 'filename', 'branch' },
-- lualine_c = {
-- '%=', --[[ add your center components here in place of this comment ]]
-- },
-- lualine_x = {},
-- lualine_y = { 'filetype', 'progress' },
-- lualine_z = {
-- { 'location', separator = { right = '' }, left_padding = 2 },
-- },
-- },
-- inactive_sections = {
-- lualine_a = { 'filename' },
-- lualine_b = {},
-- lualine_c = {},
-- lualine_x = {},
-- lualine_y = {},
-- lualine_z = { 'location' },
-- },
-- tabline = {},
-- extensions = {},
-- }
-- }
-12
View File
@@ -1,12 +0,0 @@
return{
{
"kylechui/nvim-surround",
version = "^3.0.0", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
}
}
-11
View File
@@ -1,11 +0,0 @@
return {
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
require("nvim-tree").setup {}
end,
}
-9
View File
@@ -1,9 +0,0 @@
return {
{
"yorickpeterse/nvim-window",
keys = {
{ "<leader>w", "<cmd>lua require('nvim-window').pick()<cr>", desc = "nvim-window: Jump to window" },
},
config = true,
}
}
-115
View File
@@ -1,115 +0,0 @@
return {
{
"nvim-treesitter/nvim-treesitter",
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
event = { "VeryLazy" },
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
init = function(plugin)
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
-- no longer trigger the **nvim-treesitter** module to be loaded in time.
-- Luckily, the only things that those plugins need are the custom queries, which we make available
-- during startup.
require("lazy.core.loader").add_to_rtp(plugin)
require("nvim-treesitter.query_predicates")
end,
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
keys = {
{ "<c-space>", desc = "Increment Selection" },
{ "<bs>", desc = "Decrement Selection", mode = "x" },
},
opts_extend = { "ensure_installed" },
---@type TSConfig
---@diagnostic disable-next-line: missing-fields
opts = {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
"bash",
"c",
"diff",
"html",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"printf",
"python",
"query",
"regex",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
textobjects = {
move = {
enable = true,
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" },
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" },
},
},
},
-- ---@param opts TSConfig
-- config = function(_, opts)
-- if type(opts.ensure_installed) == "table" then
-- opts.ensure_installed = LazyVim.dedup(opts.ensure_installed)
-- end
-- require("nvim-treesitter.configs").setup(opts)
-- end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
event = "VeryLazy",
enabled = true,
config = function()
-- If treesitter is already loaded, we need to run config again for textobjects
-- if LazyVim.is_loaded("nvim-treesitter") then
-- local opts = leLazyVim.opts("nvim-treesitter")
-- require("nvim-treesitter.configs").setup({ textobjects = opts.textobjects })
-- end
-- When in diff mode, we want to use the default
-- vim text objects c & C instead of the treesitter ones.
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
local configs = require("nvim-treesitter.configs")
for name, fn in pairs(move) do
if name:find("goto") == 1 then
move[name] = function(q, ...)
if vim.wo.diff then
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
for key, query in pairs(config or {}) do
if q == query and key:find("[%]%[][cC]") then
vim.cmd("normal! " .. key)
return
end
end
end
return fn(q, ...)
end
end
end
end,
},
}
-91
View File
@@ -1,91 +0,0 @@
return {
-- {
-- "folke/which-key.nvim",
-- event = "VeryLazy",
-- opts = {
-- -- your configuration comes here
-- -- or leave it empty to use the default settings
-- -- refer to the configuration section below
-- },
-- keys = {
-- {
-- "<leader>?",
-- function()
-- require("which-key").show({ global = false })
-- end,
-- desc = "Buffer Local Keymaps (which-key)",
-- },
-- },
-- },
{
"folke/which-key.nvim",
event = "VeryLazy",
opts_extend = { "spec" },
opts = {
preset = "helix",
defaults = {},
spec = {
{
mode = { "n", "v" },
-- { "<leader><tab>", group = "tabs" },
{ "<leader>c", group = "code" },
-- { "<leader>d", group = "debug" },
-- { "<leader>dp", group = "profiler" },
{ "<leader>f", group = "file/find" },
{ "<leader>g", group = "git" },
-- { "<leader>gh", group = "hunks" },
{ "<leader>q", group = "quit/session" },
{ "<leader>s", group = "search" },
{ "<leader>u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } },
{ "<leader>x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } },
{ "[", group = "prev" },
{ "]", group = "next" },
{ "g", group = "goto" },
{ "gs", group = "surround" },
{ "z", group = "fold" },
{
"<leader>b",
group = "buffer",
expand = function()
return require("which-key.extras").expand.buf()
end,
},
-- {
-- "<leader>w",
-- group = "windows",
-- proxy = "<c-w>",
-- expand = function()
-- return require("which-key.extras").expand.win()
-- end,
-- },
-- better descriptions
{ "gx", desc = "Open with system app" },
},
},
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Keymaps (which-key)",
},
{
"<c-w><space>",
function()
require("which-key").show({ keys = "<c-w>", loop = true })
end,
desc = "Window Hydra Mode (which-key)",
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
if not vim.tbl_isempty(opts.defaults) then
-- LazyVim.warn("which-key: opts.defaults is deprecated. Please use opts.spec instead.")
wk.register(opts.defaults)
end
end,
},
}
-8
View File
@@ -1,8 +0,0 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
--
-- Add any additional autocmds here
-- with `vim.api.nvim_create_autocmd`
--
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
-3
View File
@@ -1,3 +0,0 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
-74
View File
@@ -1,74 +0,0 @@
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)
-- 1.options
-- Hint: use `:h <option>` to figure out the meaning if needed
vim.opt.clipboard = "unnamedplus" -- use system clipboard
vim.opt.completeopt = { "menu", "menuone", "noselect" }
vim.opt.mouse = "a" -- allow the mouse to be used in Nvim
-- Searching
vim.opt.incsearch = true -- search as characters are entered
vim.opt.hlsearch = true -- do not highlight matches
vim.opt.ignorecase = true -- ignore case in searches by default
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
-- Tab
vim.opt.tabstop = 4 -- number of visual spaces per TAB
vim.opt.softtabstop = 4 -- number of spacesin tab when editing
vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab
vim.opt.expandtab = true -- tabs are spaces, mainly because of python
-- UI config
vim.opt.number = true -- show absolute number
vim.opt.relativenumber = true -- add numbers to each line on the left side
vim.opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
vim.opt.splitbelow = true -- open new vertical split bottom
vim.opt.splitright = true -- open new horizontal splits right
vim.opt.termguicolors = true -- enabl 24-bit RGB color in the TUI
vim.opt.showmode = false -- we are experienced, wo don't need the "-- INSERT --" mode hint
vim.opt.wrap = false -- Wrapping sucks (except on markdown)
vim.opt.swapfile = false -- Do not leave any backup files
vim.opt.showmatch = true -- Highlights the matching parenthesis
vim.opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text
vim.opt.hidden = true -- Allow multple buffers
vim.opt.shortmess:append("c") -- Don't pass messages to |ins-completion-menu|.
vim.opt.encoding = "utf-8" -- Just in case
vim.opt.cmdheight = 2 -- Shows better messages
vim.opt.foldmethod = "indent"
vim.opt.foldlevel = 99
-- vim.opt.swapfile = false
-- vim.opt.backup = false
-- vim.opt.undofile = false
-- vim.opt.writebackup = false
vim.g.mapleader = " " -- set leader key to space
vim.g.maplocalleader = "\\" -- set local leader key to space
require("lazy").setup({
spec = {
-- import your plugins
{ import = "baremetal" },
},
-- 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 },
})
-53
View File
@@ -1,53 +0,0 @@
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)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "lazyvim" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
-217
View File
@@ -1,217 +0,0 @@
-- 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)
-- Clipboard
vim.opt.clipboard = "unnamedplus" -- use system clipboard
-- Searching
vim.opt.incsearch = true -- search as characters are entered
vim.opt.hlsearch = true -- do not highlight matches
vim.opt.ignorecase = true -- ignore case in searches by default
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
-- Tab width
vim.opt.tabstop = 4 -- number of visual spaces per TAB
vim.opt.softtabstop = 4 -- number of spacesin tab when editing
vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab
vim.opt.expandtab = true -- tabs are spaces, mainly because of python
-- Leader and Local Leader
vim.g.mapleader = " " -- set leader key to space
vim.g.maplocalleader = "\\" -- set local leader key to space
local vscode = require("vscode")
vim.notify = vscode.notify
-- Code Folding
local fold = {
unfoldAll = function()
vscode.action("editor.unfoldAll")
end,
foldAll = function()
vscode.action("editor.foldAll")
end,
toggleFold = function()
vscode.action("editor.toggleFold")
end,
}
vim.keymap.set("n", "zR", fold.unfoldAll, { desc = "Fold All" })
vim.keymap.set("n", "zM", fold.foldAll, { desc = "Unfold All" })
vim.keymap.set("n", "za", fold.toggleFold, { desc = "Toggle Fold" })
-- Toggle VSCode Zen Mode
local zenMode = {
toggle = function()
vscode.action("workbench.action.toggleZenMode")
end,
}
vim.keymap.set("n", "<leader><leader>z", zenMode.toggle, { desc = "Toggle Zen Mode" })
-- Toggle VSCode Sidebar
local sidebar = {
toggleVisibility = function()
vscode.action("workbench.action.toggleSidebarVisibility")
end,
togglePosition = function()
vscode.action("workbench.action.toggleSidebarPosition")
end,
openExplorer = function()
vscode.action("workbench.view.explorer")
end,
openSearch = function()
vscode.action("workbench.view.search")
end
}
vim.keymap.set("n", "<leader><leader>b", sidebar.toggleVisibility, { desc = "Toggle Sidebar Vidibility" })
vim.keymap.set("n", "<leader><leader>B", sidebar.togglePosition, { desc = "Toggle Sidebar Position" })
vim.keymap.set("n", "<leader>be", sidebar.openExplorer, { desc = "Open Sidebar Explorer" })
vim.keymap.set("n", "<leader>bs", sidebar.openSearch, { desc = "Open Sidebar Explorer" })
-- Toggle Line-Number Mode
vim.keymap.set("n", "<leader><leader>l", function()
local lineNumbMode = vscode.get_config("editor.lineNumbers")
if lineNumbMode == "on" then
vscode.update_config("editor.lineNumbers", "relative", "workspace")
elseif lineNumbMode == "relative" then
vscode.update_config("editor.lineNumbers", "on", "workspace")
else
vscode.update_config("editor.lineNumbers", "relative", "workspace")
end
end, { desc = "Toggle Line-Number Mode" })
-- Toggle Word Wrap Mode
vim.keymap.set("n", "<leader><leader>w", function()
local wrapMode = vscode.get_config("editor.wordWrap")
if wrapMode == "on" then
vscode.update_config("editor.wordWrap", "off", "workspace")
else
vscode.update_config("editor.wordWrap", "on", "workspace")
end
end, { desc = "Toggle Word Wrap Mode" })
-- Code
vim.keymap.set("n", "<leader>cf", function()
vscode.action("editor.action.formatDocument")
end, { desc = "Format Code" })
-- Editor
local editors = {
toggleInGroup = function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup")
vscode.action("list.select")
end,
toggleCrossGroups = function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditor")
vscode.action("list.select")
end,
previous = function()
vscode.action("workbench.action.previousEditorInGroup")
end,
next = function()
vscode.action("workbench.action.nextEditorInGroup")
end,
selectCrossGroups = function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditor")
end,
selectInsideGroup = function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup")
end,
close = function()
vscode.action("workbench.action.closeActiveEditor")
end,
moveToNextGroup = function()
vscode.action("workbench.action.moveEditorToNextGroup")
end,
moveToPreviousGroup = function()
vscode.action("workbench.action.moveEditorToPreviousGroup")
end,
}
vim.keymap.set("n", "<leader><leader>e", editors.toggleInGroup, { desc = "Toggle Between Two Editors inside Group" })
vim.keymap.set("n", "<leader><leader>E", editors.toggleCrossGroups, { desc = "Toggle Between Two Editors Cross-Groups" })
vim.keymap.set("n", "<leader>eg", editors.selectCrossGroups, { desc = "Select Editor Cross-Groups" })
vim.keymap.set("n", "<leader>ei", editors.selectInsideGroup, { desc = "Select Editor Inside Group" })
vim.keymap.set("n", "<leader>eh", editors.previous, { desc = "Navigate Editors in Group: Previous" })
vim.keymap.set("n", "<leader>el", editors.next, { desc = "Navigate Editors in Group: Next" })
vim.keymap.set("n", "<leader>ed", editors.close, { desc = "Close Editor" })
vim.keymap.set('n', "<leader>emn", editors.moveToNextGroup, { desc = "Move Editor to the Next Group" })
vim.keymap.set('n', "<leader>emp", editors.moveToPreviousGroup, { desc = "Move Editor to the Previous Group" })
-- Editor Groups
-- TODO: <leader>gd to delete a group
local groups = {
toggle = function()
vscode.action("workbench.action.focusNextGroup")
end,
vertical = function()
vscode.action("workbench.action.splitEditorRight")
-- vscode.action("workbench.action.moveEditorToNextGroup")
end,
horizontal = function()
vscode.action("workbench.action.splitEditorDown")
-- vscode.action("workbench.action.moveEditorToPreviousGroup")
end,
equalGroupSize = function()
vscode.action("workbench.action.evenEditorWidths")
end,
close = function()
vscode.action("workbench.action.closeGroup")
end,
alsoCloseEditors = function()
vscode.action("workbench.action.closeEditorsAndGroup")
end,
}
vim.keymap.set("n", "<leader><leader>g", groups.toggle, { desc = "Focus Next Group" })
vim.keymap.set("n", "<leader>gv", groups.vertical, { desc = "Split Editor Group Vertically" })
vim.keymap.set("n", "<leader>gs", groups.horizontal, { desc = "Split Editor Group Horizontally" })
vim.keymap.set("n", "<leader>g=", groups.equalGroupSize, { desc = "Equal Group Size" })
vim.keymap.set("n", "<leader>gd", groups.close, { desc = "Close Group, Remain Editors" })
vim.keymap.set("n", "<leader>gD", groups.alsoCloseEditors, { desc = "Close Group and Editors" })
-- Search
local search = {
files = function()
vscode.action("workbench.action.quickOpen")
vscode.action("workbench.action.quickOpenSelectNext")
end,
symbols = function()
vscode.action("workbench.action.gotoSymbol")
end,
breadcrumbs = function()
vscode.action("breadcrumbs.focusAndSelect")
end,
editors = function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditor")
end,
}
vim.keymap.set("n", "<leader>sf", search.files, { desc = "Search Files with VSCode Ctrl-P" })
vim.keymap.set("n", "<leader>ss", search.symbols, { desc = "Search Symbols with VSCode Ctrl-P@" })
vim.keymap.set("n", "<leader>sb", search.breadcrumbs, { desc = "Search Breadcrumbs" })
vim.keymap.set("n", "<leader>se", search.editors, { desc = "Search Editors Cross-Groups" })
-- Start lazy.nvim as the plugin manager
require("lazy").setup({
spec = {
-- import your plugins
{ import = "vscodeplugins" },
},
-- 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 },
})
-16
View File
@@ -1,16 +0,0 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
if vim.loop.os_uname().sysname == "Windows_NT" then -- set default shell to pwsh/powershell on Windows
LazyVim.terminal.setup("powershell")
end
-- Tabs
vim.opt.tabstop = 4 -- number of visual spaces per TAB
vim.opt.softtabstop = 4 -- number of spacesin tab when editing
vim.opt.shiftwidth = 4 -- Size of an indent
vim.opt.expandtab = true -- tabs are spaces, mainly because of python
vim.g.autoformat = false
-35
View File
@@ -1,35 +0,0 @@
return {
{
"snacks.nvim",
opts = {
dashboard = {
preset = {
pick = function(cmd, opts)
return LazyVim.pick(cmd, opts)()
end,
header = [[
██████╗ ██╗ ██╗██████╗
██╔════╝ ██║ ██║██╔══██╗
██║ ███╗██║ █╗ ██║██████╔╝
██║ ██║██║███╗██║██╔══██╗
╚██████╔╝╚███╔███╔╝██████╔╝
╚═════╝ ╚══╝╚══╝ ╚═════╝
]],
-- stylua: ignore
---@type snacks.dashboard.Item[]
keys = {
{ icon = "", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
{ icon = "", key = "n", desc = "New File", action = ":ene | startinsert" },
{ icon = "", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
{ icon = "", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
{ icon = "", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
{ icon = "", key = "s", desc = "Restore Session", section = "session" },
{ icon = "", key = "x", desc = "Lazy Extras", action = ":LazyExtras" },
{ icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" },
{ icon = "", key = "q", desc = "Quit", action = ":qa" },
},
},
},
},
},
}
-197
View File
@@ -1,197 +0,0 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, {
function()
return "😄"
end,
})
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}
-26
View File
@@ -1,26 +0,0 @@
return {
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
modes = {
search = { enabled = true },
char = { enabled = false },
-- treesitter = { enabled = true, highlight = { backdrop = false } },
-- remote = { enabled = true, highlight = { backdrop = false } },
},
},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, false },
{ "S", mode = { "n", "o", "x" }, false },
{ "r", mode = "o", false },
{ "R", mode = { "o", "x" }, false },
{ "<c-s>", mode = { "c" }, false },
{ "<a-/>", mode = { "n", "x", "o" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
-- { "<leader>j", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "<leader>ct", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
},
}
}
-12
View File
@@ -1,12 +0,0 @@
return {
{
"kylechui/nvim-surround",
version = "^3.0.0", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end,
},
}
-9
View File
@@ -1,9 +0,0 @@
return {
{
"yorickpeterse/nvim-window",
keys = {
{ "<leader>ww", "<cmd>lua require('nvim-window').pick()<cr>", desc = "nvim-window: Jump to window" },
},
config = true,
}
}
-14
View File
@@ -1,14 +0,0 @@
return {
-- { "vim-neo-tree/neo-tree.nvim", enabled = false },
-- {
-- "nvim-tree/nvim-tree.lua",
-- version = "*",
-- lazy = false,
-- dependencies = {
-- "nvim-tree/nvim-web-devicons",
-- },
-- config = function()
-- require("nvim-tree").setup {}
-- end,
-- }
}
+52
View File
@@ -0,0 +1,52 @@
local M = {}
function M.setup()
require("gitsigns").setup({
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,
numhl = false,
linehl = false,
word_diff = false,
watch_gitdir = { follow_files = true },
auto_attach = true,
attach_to_untracked = false,
current_line_blame = true,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol",
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,
max_file_length = 40000,
preview_config = {
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
})
end
return M
+11
View File
@@ -0,0 +1,11 @@
local M = {}
function M.setup()
require("lualine").setup({
options = {
theme = "auto",
},
})
end
return M
+7
View File
@@ -0,0 +1,7 @@
local M = {}
function M.setup()
require("nvim-tree").setup({})
end
return M
+102
View File
@@ -0,0 +1,102 @@
local M = {}
function M.setup()
local ok_configs, ts_configs = pcall(require, "nvim-treesitter.configs")
if not ok_configs then
vim.schedule(function()
vim.notify("nvim-treesitter is not available yet. Run :lua vim.pack.update() and restart.",
vim.log.levels.WARN)
end)
return
end
ts_configs.setup({
ensure_installed = {
"bash",
"c",
"diff",
"html",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"printf",
"python",
"query",
"regex",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
textobjects = {
move = {
enable = true,
goto_next_start = {
["]f"] = "@function.outer",
["]c"] = "@class.outer",
["]a"] = "@parameter.inner",
},
goto_next_end = {
["]F"] = "@function.outer",
["]C"] = "@class.outer",
["]A"] = "@parameter.inner",
},
goto_previous_start = {
["[f"] = "@function.outer",
["[c"] = "@class.outer",
["[a"] = "@parameter.inner",
},
goto_previous_end = {
["[F"] = "@function.outer",
["[C"] = "@class.outer",
["[A"] = "@parameter.inner",
},
},
},
})
local ok_move, move = pcall(require, "nvim-treesitter.textobjects.move")
if not ok_move then
return
end
for name, fn in pairs(move) do
if name:find("goto") == 1 then
move[name] = function(query, ...)
if vim.wo.diff then
local config = ts_configs.get_module("textobjects.move")[name]
for key, textobject in pairs(config or {}) do
if query == textobject and key:find("[%]%[][cC]") then
vim.cmd("normal! " .. key)
return
end
end
end
return fn(query, ...)
end
end
end
end
return M
+36
View File
@@ -0,0 +1,36 @@
local M = {}
function M.setup()
local wk = require("which-key")
wk.setup({
preset = "helix",
})
wk.add({
{ mode = { "n", "v" } },
{ "<leader>c", group = "code" },
{ "<leader>f", group = "file/find" },
{ "<leader>g", group = "git" },
{ "<leader>q", group = "quit/session" },
{ "<leader>s", group = "search" },
{ "<leader>u", group = "ui" },
{ "<leader>x", group = "diagnostics/quickfix" },
{ "[", group = "prev" },
{ "]", group = "next" },
{ "g", group = "goto" },
{ "gs", group = "surround" },
{ "z", group = "fold" },
{ "gx", desc = "Open with system app" },
})
vim.keymap.set("n", "<leader>?", function()
wk.show({ global = false })
end, { desc = "Buffer Keymaps (which-key)" })
vim.keymap.set("n", "<c-w><space>", function()
wk.show({ keys = "<c-w>", loop = true })
end, { desc = "Window Hydra Mode (which-key)" })
end
return M
+9
View File
@@ -0,0 +1,9 @@
local M = {}
function M.setup()
vim.keymap.set("n", "<leader>w", function()
require("nvim-window").pick()
end, { desc = "Jump to window" })
end
return M
+27
View File
@@ -0,0 +1,27 @@
local M = {}
local function to_src(value)
if value:match("^[%w+.-]+://") or value:match("^git@") then
return value
end
return "https://github.com/" .. value
end
function M.add(specs)
local resolved = {}
for _, spec in ipairs(specs) do
if type(spec) == "string" then
table.insert(resolved, to_src(spec))
else
local plugin = vim.deepcopy(spec)
plugin.src = to_src(plugin.src)
table.insert(resolved, plugin)
end
end
vim.pack.add(resolved, { confirm = false, load = true })
end
return M
+136
View File
@@ -0,0 +1,136 @@
local M = {}
function M.setup(vscode)
local fold = {
unfold_all = function()
vscode.action("editor.unfoldAll")
end,
fold_all = function()
vscode.action("editor.foldAll")
end,
toggle = function()
vscode.action("editor.toggleFold")
end,
}
vim.keymap.set("n", "zR", fold.unfold_all, { desc = "Unfold All" })
vim.keymap.set("n", "zM", fold.fold_all, { desc = "Fold All" })
vim.keymap.set("n", "za", fold.toggle, { desc = "Toggle Fold" })
vim.keymap.set("n", "<leader><leader>z", function()
vscode.action("workbench.action.toggleZenMode")
end, { desc = "Toggle Zen Mode" })
vim.keymap.set("n", "<leader><leader>b", function()
vscode.action("workbench.action.toggleSidebarVisibility")
end, { desc = "Toggle Sidebar Visibility" })
vim.keymap.set("n", "<leader><leader>B", function()
vscode.action("workbench.action.toggleSidebarPosition")
end, { desc = "Toggle Sidebar Position" })
vim.keymap.set("n", "<leader>be", function()
vscode.action("workbench.view.explorer")
end, { desc = "Open Sidebar Explorer" })
vim.keymap.set("n", "<leader>bs", function()
vscode.action("workbench.view.search")
end, { desc = "Open Sidebar Search" })
vim.keymap.set("n", "<leader><leader>l", function()
local line_numbers = vscode.get_config("editor.lineNumbers")
local next_value = line_numbers == "on" and "relative" or "on"
vscode.update_config("editor.lineNumbers", next_value, "workspace")
end, { desc = "Toggle Line Number Mode" })
vim.keymap.set("n", "<leader><leader>w", function()
local wrap_mode = vscode.get_config("editor.wordWrap")
local next_value = wrap_mode == "on" and "off" or "on"
vscode.update_config("editor.wordWrap", next_value, "workspace")
end, { desc = "Toggle Word Wrap Mode" })
vim.keymap.set("n", "<leader>cf", function()
vscode.action("editor.action.formatDocument")
end, { desc = "Format Code" })
vim.keymap.set("n", "<leader><leader>e", function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup")
vscode.action("list.select")
end, { desc = "Toggle Between Two Editors Inside Group" })
vim.keymap.set("n", "<leader><leader>E", function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditor")
vscode.action("list.select")
end, { desc = "Toggle Between Two Editors Cross Groups" })
vim.keymap.set("n", "<leader>eg", function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditor")
end, { desc = "Select Editor Cross Groups" })
vim.keymap.set("n", "<leader>ei", function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup")
end, { desc = "Select Editor Inside Group" })
vim.keymap.set("n", "<leader>eh", function()
vscode.action("workbench.action.previousEditorInGroup")
end, { desc = "Previous Editor In Group" })
vim.keymap.set("n", "<leader>el", function()
vscode.action("workbench.action.nextEditorInGroup")
end, { desc = "Next Editor In Group" })
vim.keymap.set("n", "<leader>ed", function()
vscode.action("workbench.action.closeActiveEditor")
end, { desc = "Close Editor" })
vim.keymap.set("n", "<leader>emn", function()
vscode.action("workbench.action.moveEditorToNextGroup")
end, { desc = "Move Editor To Next Group" })
vim.keymap.set("n", "<leader>emp", function()
vscode.action("workbench.action.moveEditorToPreviousGroup")
end, { desc = "Move Editor To Previous Group" })
vim.keymap.set("n", "<leader><leader>g", function()
vscode.action("workbench.action.focusNextGroup")
end, { desc = "Focus Next Group" })
vim.keymap.set("n", "<leader>gv", function()
vscode.action("workbench.action.splitEditorRight")
end, { desc = "Split Editor Group Vertically" })
vim.keymap.set("n", "<leader>gs", function()
vscode.action("workbench.action.splitEditorDown")
end, { desc = "Split Editor Group Horizontally" })
vim.keymap.set("n", "<leader>g=", function()
vscode.action("workbench.action.evenEditorWidths")
end, { desc = "Equal Group Size" })
vim.keymap.set("n", "<leader>gd", function()
vscode.action("workbench.action.closeGroup")
end, { desc = "Close Group, Keep Editors" })
vim.keymap.set("n", "<leader>gD", function()
vscode.action("workbench.action.closeEditorsAndGroup")
end, { desc = "Close Group And Editors" })
vim.keymap.set("n", "<leader>sf", function()
vscode.action("workbench.action.quickOpen")
vscode.action("workbench.action.quickOpenSelectNext")
end, { desc = "Search Files" })
vim.keymap.set("n", "<leader>ss", function()
vscode.action("workbench.action.gotoSymbol")
end, { desc = "Search Symbols" })
vim.keymap.set("n", "<leader>sb", function()
vscode.action("breadcrumbs.focusAndSelect")
end, { desc = "Search Breadcrumbs" })
vim.keymap.set("n", "<leader>se", function()
vscode.action("workbench.action.quickOpenPreviousRecentlyUsedEditor")
end, { desc = "Search Editors Cross Groups" })
end
return M
+77
View File
@@ -0,0 +1,77 @@
local M = {}
local function setup_flash(keys)
require("flash").setup({
modes = {
search = { enabled = keys.search ~= false },
char = { enabled = keys.char == true },
},
})
if keys.jump_key then
vim.keymap.set({ "n", "x", "o" }, keys.jump_key, function()
require("flash").jump()
end, { desc = "Flash" })
end
if keys.toggle_search_key then
vim.keymap.set({ "n", "x", "o" }, keys.toggle_search_key, function()
require("flash").toggle()
end, { desc = "Toggle Flash Search" })
end
if keys.treesitter_key then
vim.keymap.set({ "n", "x", "o" }, keys.treesitter_key, function()
require("flash").treesitter()
end, { desc = "Flash Treesitter" })
end
end
function M.setup()
require("plugins.pack").add({
"folke/flash.nvim",
"folke/which-key.nvim",
"kylechui/nvim-surround",
"lewis6991/gitsigns.nvim",
"nvim-lualine/lualine.nvim",
"nvim-tree/nvim-tree.lua",
"nvim-tree/nvim-web-devicons",
"nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter-textobjects",
"yorickpeterse/nvim-window",
})
vim.opt.completeopt = { "menu", "menuone", "noselect" }
vim.opt.mouse = "a"
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.termguicolors = true
vim.opt.showmode = false
vim.opt.wrap = false
vim.opt.swapfile = false
vim.opt.showmatch = true
vim.opt.signcolumn = "yes"
vim.opt.hidden = true
vim.opt.shortmess:append("c")
vim.opt.encoding = "utf-8"
vim.opt.cmdheight = 2
vim.opt.foldmethod = "indent"
vim.opt.foldlevel = 99
setup_flash({
jump_key = "<leader>s",
treesitter_key = "<leader>S",
})
require("nvim-surround").setup({})
require("plugins.native.git").setup()
require("plugins.native.tree").setup()
require("plugins.native.statusline").setup()
require("plugins.native.treesitter").setup()
require("plugins.native.which_key").setup()
require("plugins.native.window").setup()
end
return M
+49
View File
@@ -0,0 +1,49 @@
local M = {}
local function setup_flash(keys)
require("flash").setup({
modes = {
search = { enabled = keys.search ~= false },
char = { enabled = keys.char == true },
},
})
if keys.jump_key then
vim.keymap.set({ "n", "x", "o" }, keys.jump_key, function()
require("flash").jump()
end, { desc = "Flash" })
end
if keys.toggle_search_key then
vim.keymap.set({ "n", "x", "o" }, keys.toggle_search_key, function()
require("flash").toggle()
end, { desc = "Toggle Flash Search" })
end
if keys.treesitter_key then
vim.keymap.set({ "n", "x", "o" }, keys.treesitter_key, function()
require("flash").treesitter()
end, { desc = "Flash Treesitter" })
end
end
function M.setup()
require("plugins.pack").add({
"folke/flash.nvim",
{ src = "kylechui/nvim-surround", version = vim.version.range("3") },
})
local vscode = require("vscode")
vim.notify = vscode.notify
setup_flash({
toggle_search_key = "<leader><leader>/",
treesitter_key = "<leader>ct",
search = true,
char = false,
})
require("nvim-surround").setup({})
require("plugins.vscode.actions").setup(vscode)
end
return M
-33
View File
@@ -1,33 +0,0 @@
return {
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
modes = {
search = { enabled = true },
char = { enabled = false },
-- treesitter = { enabled = true, highlight = { backdrop = false } },
-- remote = { enabled = true, highlight = { backdrop = false } },
},
},
-- stylua: ignore
keys = {
{ "<leader><leader>/", mode = { "n", "x", "o" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
-- { "<leader>j", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "<leader>ct", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
-- { "<leader>r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
-- { "<leader>R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
},
},
{
"kylechui/nvim-surround",
version = "^3.0.0", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end,
},
}
-3
View File
@@ -1,3 +0,0 @@
indent_type = "Spaces"
indent_width = 4
column_width = 120