feat(nvim): Build another nvim from scratch

* Neovim: Backup original LazyVim setup to .config/nvim.lazy.d
* Neovim: Currently done with basic completions and LSP
* Git: Always use ssh to connect github remote
* Zsh: Add more antidots config
This commit is contained in:
js0ny 2024-11-28 01:48:26 +00:00
parent 74f2883139
commit eeb3387112
53 changed files with 1617 additions and 682 deletions

BIN
.config/nvim/.DS_Store vendored

Binary file not shown.

View file

@ -0,0 +1,12 @@
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.lua]
indent_type = "Spaces"
indent_width = 2
column_width = 120

1
.config/nvim/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
lazy-lock.json

View file

@ -1,15 +0,0 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

View file

@ -1,22 +0,0 @@
return {
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",
-- see below for full list of optional dependencies 👇
},
opts = {
workspaces = {
{
name = "Obsidian",
path = "~/Obsidian",
},
},
-- see below for full list of options 👇
},
}

View file

@ -1,8 +0,0 @@
# Colemak *LazyVim*
- Replace the default `hjkl` movement keys with `hnei`
- `j->e`, `k->n`, `h->h`, `l->i`
```sh
ln -sf $DOTFILES/.config/nvim/ $XDG_CONFIG_HOME/nvim
```

View file

@ -1,8 +1,20 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
if (vim.g.vscode) then
print("VSCode detected, skipping lazy loading")
require("vscode.code")
else
require("config.lazy")
-- require("config.lazy")
end
--[[
-*- coding: utf-8 -*-
@Filename init.lua
@Author js0ny
@Date 2024-11-27
@Description neovim
]]
-- 加载配置
require("config.options")
-- 加载键位映射
require("config.keymaps")
-- 加载插件
require("plugins")
-- 加载主题
require("config.colorscheme")
-- vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })

Binary file not shown.

View file

@ -1,3 +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

View file

@ -0,0 +1 @@
vim.cmd.colorscheme("catppuccin")

View file

@ -1,146 +1,128 @@
-- 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
vim.g.mapleader = " "
-- ================= GENERAL KEYBINDS =================
-- SAVE/QUIT {{{
vim.keymap.set("n", "Q", "<cmd>q<CR>", { desc = "Q to quit" })
vim.keymap.set("n", "<C-s>", "<cmd>w<CR>", { desc = "S to write file" })
--}}}
-- NVIM CONFIG SHORTCUTS {{{
-- stylua: ignore
vim.keymap.set("n", "<leader>rc", "<cmd>e $HOME/.config/nvim/lua/config/options.lua<CR>", { desc = "Open nvim options.lua" })
vim.keymap.set("n", "<leader>rp", "<cmd>e $HOME/.config/nvim/lua/plugins/.<CR>", { desc = "lazy plugins dir" })
--}}}
-- UNDO
vim.keymap.set({ "n", "v" }, "l", "u", { desc = "Undo" })
-- INSERT
vim.keymap.set({ "n", "v" }, "l", "i", { desc = "Insert" })
vim.keymap.set({ "n", "v" }, "L", "I", { desc = "Insert at line start" })
-- YANK TO SYSTEM CLIPBOARD
vim.keymap.set("v", "Y", '"+y', { desc = "Copy to (System) Clipboard" })
-- SEARCH {{{
vim.keymap.set("n", "<LEADER><CR>", "<CMD>nohlsearch<CR>", { desc = "clear search highlight" })
--}}}
-- SPACE TO TAB{{{
vim.keymap.set("n", "<LEADER>tt", "<CMD>%s/ /\t/g<CR>", { desc = "space to tab" })
vim.keymap.set("v", "<LEADER>tt", "<CMD>s/ /\t/g<CR>", { desc = "space to tab" })
--}}}
-- MISC {{{
vim.keymap.set("n", "<LEADER>o", "za", { desc = "folding" })
vim.keymap.set("i", "<C-y>", "<ESC>A {}<ESC>i<CR><ESC>ko", { desc = "insert a pair of {} and goto next line" })
--}}}
-- ================= CURSOR MOVEMENT ===================== {{{
-- NEW CURSOR MOVEMENT (ARROW KEY RESIZE WINDOWS)
-- ^
-- e
-- < h i >
-- n
-- v
--
vim.keymap.set({ "n", "v", "", "s", "x" }, "e", "k", { desc = "move cursor ⇧" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "n", "j", { desc = "move cursor ⇩" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "h", "h", { desc = "move cursor ⇦" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "i", "l", { desc = "move cursor ⇨" })
vim.keymap.set({ "n", "v" }, "E", "5k", { desc = "Move 5up K -> U" })
vim.keymap.set({ "n", "v" }, "N", "5j", { desc = "Move 5down J -> E" })
vim.keymap.set({ "n", "v" }, "H", "0", { desc = "Move start of line" })
vim.keymap.set({ "n", "v" }, "I", "$", { desc = "Move end of line" })
vim.keymap.set("n", "gu", "gk", { desc = "move up gk -> gu" })
vim.keymap.set("n", "ge", "gj", { desc = "move down gj -> ge" })
vim.keymap.set("n", "\v", "v$h", { desc = "???" })
-- FASTER IN-LINE NAVIGATION
-- SET h (SAME AS n, CURSOR LEFT) TO 'END OF WORD'
vim.keymap.set("n", "j", "e", { desc = "Move cursor to end of word" })
-- CTRL + U OR E WILL MOVE UP/DOWN THE VIEW PORT WITHOUT MOVING THE CURSOR
vim.keymap.set({ "n", "v" }, "<C-e>", "5<C-y>", { desc = "Move viewport ⇧" })
vim.keymap.set({ "n", "v" }, "<C-n>", "5<C-e>", { desc = "Move viewport ⇩" })
-- INSERT MODE CURSOR MOVEMENT
vim.keymap.set("i", "<C-a>", "<ESC>A")
-- COMMAND MODE CURSOR MOVEMENT
vim.keymap.set("c", "<C-a>", "<Home>")
vim.keymap.set("c", "<C-e>", "<End>")
vim.keymap.set("c", "<C-p>", "<Up>")
vim.keymap.set("c", "<C-n>", "<Down>")
vim.keymap.set("c", "<C-b>", "<Left>")
vim.keymap.set("c", "<C-f>", "<Right>")
vim.keymap.set("c", "<M-b>", "<S-Left>")
vim.keymap.set("c", "<M-w>", "<S-Right>")
--}}}
-- ================= SPLIT MANAGMENT ===================== {{{
vim.keymap.set("n", "<C-w>E", "<CMD>set nosplitbelow<CR><CMD>split<CR><CMD>set splitbelow<CR>", { desc = "Split ⇧" })
vim.keymap.set("n", "<C-w>N", "<CMD>set splitbelow<CR><CMD>split<CR>", { desc = "Split ⇩" })
vim.keymap.set("n", "<C-w>H", "<CMD>set nosplitright<CR><CMD>vsplit<CR><CMD>set splitright<CR>", { desc = "Split ⇦" })
vim.keymap.set("n", "<C-w>I", "<CMD>set splitright<CR><CMD>vsplit<CR>", { desc = "Split ⇨" })
vim.keymap.set({ "n", "t" }, "<C-w>e", "<C-w>k", { desc = "Move cursor to split ⇧" })
vim.keymap.set({ "n", "t" }, "<C-w>n", "<C-w>j", { desc = "Move cursor to split ⇩" })
vim.keymap.set({ "n", "t" }, "<C-w>h", "<C-w>h", { desc = "Move cursor to split ⇦" })
vim.keymap.set({ "n", "t" }, "<C-w>i", "<C-w>l", { desc = "Move cursor to split ⇨" })
vim.keymap.set({ "n", "t" }, "<C-e>", "<C-k>", { desc = "Move cursor to split ⇧" })
vim.keymap.set({ "n", "t" }, "<C-n>", "<C-j>", { desc = "Move cursor to split ⇩" })
vim.keymap.set({ "n", "t" }, "<C-h>", "<C-h>", { desc = "Move cursor to split ⇦" })
vim.keymap.set({ "n", "t" }, "<C-i>", "<C-l>", { desc = "Move cursor to split ⇨" })
vim.keymap.set("n", "<up>", "<CMD>res -5<CR>", { desc = "Resize split 0,-5" })
vim.keymap.set("n", "<down>", "<CMD>res +5<CR>", { desc = "Resize split 0,+5" })
vim.keymap.set("n", "<left>", "<CMD>vertical resize +5<CR>", { desc = "Resize split +5,0" })
vim.keymap.set("n", "<right>", "<CMD>vertical resize -5<CR>", { desc = "Resize split -5,0" })
vim.keymap.set("n", "<C-w>H", "<C-w>t<C-w>K", { desc = "Make splits [H]orizontal" })
vim.keymap.set("n", "<C-w>V", "<C-w>t<C-w>H", { desc = "Make splits [V]ertical" })
vim.keymap.set("n", "<C-w>ri", "<C-w>b<C-w>K", { desc = "Rotate splits 90" })
vim.keymap.set("n", "<C-w>rh", "<C-w>b<C-w>H", { desc = "Rotate splits -90" })
vim.keymap.set("n", "<LEADER>q", "<C-w>j<CMD>q<CR>", { desc = "Close Split ⇩ (Below)" })
--}}}
-- TAB MANAGEMENT {{{
vim.keymap.set("n", "<TAB><TAB>", "<CMD>tabe<CR>", { desc = "New [Tab]" })
vim.keymap.set("n", "<TAB>h", "<CMD>-tabnext<CR>", { desc = "Select Tab ⇦" })
vim.keymap.set("n", "<TAB>i", "<CMD>+tabnext<CR>", { desc = "Select Tab ⇨" })
vim.keymap.set("n", "<TAB>H", "<CMD>-tabmove<CR>", { desc = "Tab move ⇦" })
vim.keymap.set("n", "<TAB>I", "<CMD>+tabmove<CR>", { desc = "Tab move ⇨" })
-- NOTE: Doesn't seem to work:
-- vim.keymap.set("n", "<TAB>c", "<CMD>tab split<CR>", { desc = "New Tab from [C]urrent" })
-- vim.keymap.set('n', '<LEADER>dw', '/\(\<\w\+\>\)\_s*\1', {desc='adjacent duplicate words'})
--vim.keymap.del("n", "<C-w>j")
--vim.keymap.del("n", "<C-w>k")
--vim.keymap.del("n", "<C-w>l")
-- }}}
-- =================== TERM BEHAVIORS ====================
vim.keymap.set("t", "<C-n>", "<C-\\><C-n>", { desc = "escape terminal, allowing excmds" })
vim.keymap.set("t", "<C-o>", "<C-\\><C-n><C-o>", { desc = "close terminal" })
--vim: set fdm=marker fdl=0
-- buffers
vim.keymap.set("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
vim.keymap.set("n", "<S-i>", "<cmd>bnext<cr>", { desc = "Next Buffer" })
local M = {}
local global_default_opts = { noremap = true, silent = true }
local global_default_mode = { "n" }
local mode_arrow = { "n", "v", "o", "s", "x" }
local function set_keymaps(maps, default_opts, default_mode)
for _, map in ipairs(maps) do
local opts = vim.tbl_extend("force", default_opts, map.opts or {})
local mode = map.mode or global_default_mode
vim.keymap.set(mode, map.keys, map.cmd, opts)
end
end
local keymaps_basic = { -- Modification of Original Keymap - Colemak
{ mode = mode_arrow, keys = "n", cmd = "j" },
{ mode = mode_arrow, keys = "e", cmd = "k" },
{ mode = mode_arrow, keys = "i", cmd = "l" },
{ keys = "N", cmd = "J" },
{ keys = "E", cmd = "K" },
{ keys = "I", cmd = "L" },
{ keys = "l", cmd = "i" },
{ keys = "L", cmd = "I" },
{ keys = "k", cmd = "n" },
{ keys = "K", cmd = "N" },
{ keys = "j", cmd = "e" },
{ keys = "J", cmd = "E" },
{ keys = "Y", cmd = "y$"},
}
local keymaps_lsp = {
}
local keymaps_nvim_tree_general = {
{ mode = "n", keys = "<leader>e", cmd = ":NvimTreeToggle<CR>" },
}
set_keymaps(keymaps_basic, global_default_opts, global_default_mode)
set_keymaps(keymaps_lsp, global_default_opts, global_default_mode)
set_keymaps(keymaps_nvim_tree_general, global_default_opts, global_default_mode)
function M.nvim_tree_keymaps(api, opts)
-- mode is set to "n" by default, in `./lua/plugins/nvim-tree.lua`
return {
-- Toggle
{ keys = "<leader>e", cmd = ":NvimTreeToggle<CR>", opts = opts("Toggle") },
-- Arrow 箭头 hnei
{ keys = "h", cmd = api.node.navigate.parent_close, opts = opts("Close node") },
{ keys = "i", cmd = api.node.open.edit, opts = opts("Open") },
{ keys = "H", cmd = api.tree.toggle_hidden_filter, opts = opts("Toggle Dotfiles") },
{ keys = "N", cmd = api.node.navigate.sibling.next, opts = opts("Next Sibling") },
{ keys = "E", cmd = api.node.navigate.sibling.prev, opts = opts("Previous Sibling") },
{ keys = "I", cmd = api.tree.toggle_gitignore_filter, opts = opts("Toggle GitIgnored") },
-- CONTROL KEYS 控制键
{ keys = "<BS>", cmd = api.node.navigate.parent_close, opts = opts("Close node") },
{ keys = "<CR>", cmd = api.node.open.edit, opts = opts("Open") },
{ keys = "<Tab>", cmd = api.node.open.preview, opts = opts("Open Preview") },
-- Alpha 字母键
{ keys = "a", cmd = api.fs.create, opts = opts("Create") },
{ keys = "A", cmd = api.fs.create, opts = opts("Create") },
{ keys = "bd", cmd = api.marks.bulk.delete, opts = opts("Delete Bookmarked") },
{ keys = "bt", cmd = api.marks.bulk.trash, opts = opts("Trash Bookmarked") },
{ keys = "bmv", cmd = api.marks.bulk.move, opts = opts("Move Bookmarked") },
{ keys = "B", cmd = api.tree.toggle_no_buffer_filter, opts = opts("Toggle Filter: No Buffer") },
{ keys = "c", cmd = api.fs.copy.node, opts = opts("Copy") },
{ keys = "C", cmd = api.fs.copy.filename, opts = opts("Copy") },
{ keys = "d", cmd = api.fs.remove, opts = opts("Delete") },
{ keys = "D", cmd = api.fs.trash, opts = opts("Trash") },
{ keys = "]e", cmd = api.node.navigate.diagnostics.next, opts = opts("Next Diagnostic") },
{ keys = "[e", cmd = api.node.navigate.diagnostics.prev, opts = opts("Prev Diagnostic") },
{ keys = "F", cmd = api.live_filter.clear, opts = opts("Live Filter: Clear") },
{ keys = "f", cmd = api.live_filter.start, opts = opts("Live Filter: Start") },
{ keys = "[g", cmd = api.node.navigate.git.prev, opts = opts("Prev Git") },
{ keys = "]g", cmd = api.node.navigate.git.next, opts = opts("Next Git") },
{ keys = "L", cmd = api.node.open.toggle_group_empty, opts = opts("Toggle Group Empty") },
{ keys = "M", cmd = api.tree.toggle_no_bookmark_filter, opts = opts("Toggle Filter: No Bookmark") },
{ keys = "m", cmd = api.marks.toggle, opts = opts("Toggle Bookmark") },
{ keys = "o", cmd = api.node.open.edit, opts = opts("Open") },
{ keys = "O", cmd = api.node.open.no_window_picker, opts = opts("Open: No Window Picker") },
{ keys = "p", cmd = api.fs.paste, opts = opts("Paste") },
{ keys = "P", cmd = api.node.navigate.parent, opts = opts("Parent Directory") },
{ keys = "q", cmd = api.tree.close, opts = opts("Close") },
{ keys = "r", cmd = api.fs.rename, opts = opts("Rename") },
{ keys = "R", cmd = api.tree.reload, opts = opts("Refresh") },
{ keys = "s", cmd = api.node.run.system, opts = opts("Run System") },
{ keys = "S", cmd = api.tree.search_node, opts = opts("Search") },
{ keys = "u", cmd = api.fs.rename_full, opts = opts("Rename: Full Path") },
{ keys = "U", cmd = api.tree.toggle_custom_filter, opts = opts("Toggle Filter: Hidden") },
{ keys = "W", cmd = api.tree.collapse_all, opts = opts("Collapse") },
{ keys = "x", cmd = api.fs.cut, opts = opts("Cut") },
{ keys = "y", cmd = api.fs.copy.relative_path, opts = opts("Copy Relative Path") },
{ keys = "Y", cmd = api.fs.copy.absolute_path, opts = opts("Copy Absolute Path") },
-- Numeric 数字键
{ keys = "!", cmd = api.node.run.cmd, opts = opts("Run Command") },
-- Non-Alphanumeric 非字母数字键
{ keys = "?", cmd = api.tree.toggle_help, opts = opts("Help") },
{ keys = ">", cmd = api.node.navigate.sibling.next, opts = opts("Next Sibling") },
{ keys = "<", cmd = api.node.navigate.sibling.prev, opts = opts("Previous Sibling") },
{ keys = ".", cmd = api.node.run.cmd, opts = opts("Run Command") },
{ keys = ";", cmd = api.node.run.cmd, opts = opts("Run Command") },
{ keys = "-", cmd = api.tree.change_root_to_parent, opts = opts("Up") },
-- MOD KEYS Ctrl+
{ keys = "<C-]>", cmd = api.tree.change_root_to_node, opts = opts("CD") },
{ keys = "<C-e>", cmd = api.node.open.replace_tree_buffer, opts = opts("Open: In Place") },
{ keys = "<C-k>", cmd = api.node.show_info_popup, opts = opts("Info") },
{ keys = "<C-r>", cmd = api.fs.rename_sub, opts = opts("Rename: Omit Filename") },
{ keys = "<C-t>", cmd = api.node.open.tab, opts = opts("Open: New Tab") },
{ keys = "<C-v>", cmd = api.node.open.vertical, opts = opts("Open: Vertical Split") },
{ keys = "<C-h>", cmd = api.node.open.horizontal, opts = opts("Open: Horizontal Split") },
-- Mouse 鼠标键
{ keys = "<2-LeftMouse>", cmd = api.node.open.edit, opts = opts("Open") },
{ keys = "<2-RightMouse>",cmd = api.tree.change_root_to_node, opts = opts("CD") },
}
end
--- `map` default for `cmp.mapping`
function M.cmp_nvim_keymaps(map)
return {
{ keys = "<C-n>", cmd = map.select_next_item(), desc = "Select next completion item" },
{ keys = "<C-p>", cmd = map.select_prev_item(), desc = "Select previous completion item" },
{ keys = "<C-y>", cmd = map.confirm({ select = true }), desc = "Confirm completion" },
{ keys = "<C-Space>", cmd = map.complete(), desc = "Trigger completion" },
{ keys = "<C-e>", cmd = map.abort(), desc = "Abort completion" },
}
end
return M

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 = "plugins" },
},
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",
},
},
},
})

View file

@ -1,3 +1,50 @@
-- 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
-- <leader> is space
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Disable netrw
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Disable Perl
vim.g.loaded_perl_provider = 0 -- Don't load Perl
vim.g.autoformat = true
local opt = vim.opt
-- Clipboard
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus"
-- Line number
opt.number = true
opt.relativenumber = true
opt.confirm = true
-- Word wrap
opt.linebreak = true
-- Indentation
opt.expandtab = true
opt.shiftwidth = 4
opt.shiftround = true
-- Case
opt.ignorecase = true
opt.smartcase = true
opt.cursorline = true
-- Terminal GUI
opt.termguicolors = true
-- Fold
opt.foldlevel = 99
opt.foldmethod = "expr"
-- Statusline
opt.laststatus = 0
-- Hide Command Line if empty
opt.cmdheight = 0
-- Scroll
opt.scrolloff = 5
opt.sidescrolloff = 10

View file

@ -0,0 +1,22 @@
--- Available LSP goes here
--- Check https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
--- for available server and name
local servers = {
"arduino_language_server", -- Arduino
"bashls", -- Bash
"clangd", -- C/C++
"cmake", -- CMake
"eslint", -- JavaScript
"gopls", -- Go
"html", -- HTML
"julials", -- Julia
"lua_ls", -- Lua
"omnisharp", -- C# & F#
"powershell_es", -- PowerShell
"pyright", -- Python
"rust_analyzer", -- Rust
"taplo", -- TOML
"vimls", -- vimscript
}
return servers

View file

@ -0,0 +1,12 @@
return {
{ "catppuccin/nvim", name = "catppuccin" },
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require("plugins.mod.lualine")
end,
},
{ import = "plugins.mod.alpha-nvim" },
}

View file

@ -1,54 +0,0 @@
return {
"catppuccin/nvim",
lazy = true,
name = "catppuccin",
opts = {
integrations = {
aerial = true,
alpha = true,
cmp = true,
dashboard = true,
flash = true,
grug_far = true,
gitsigns = true,
headlines = true,
illuminate = true,
indent_blankline = { enabled = true },
leap = true,
lsp_trouble = true,
mason = true,
markdown = true,
mini = true,
native_lsp = {
enabled = true,
underlines = {
errors = { "undercurl" },
hints = { "undercurl" },
warnings = { "undercurl" },
information = { "undercurl" },
},
},
navic = { enabled = true, custom_bg = "lualine" },
neotest = true,
neotree = true,
noice = true,
notify = true,
semantic_tokens = true,
telescope = true,
treesitter = true,
treesitter_context = true,
which_key = true,
},
},
specs = {
{
"akinsho/bufferline.nvim",
optional = true,
opts = function(_, opts)
if (vim.g.colors_name or ""):find("catppuccin") then
opts.highlights = require("catppuccin.groups.integrations.bufferline").get()
end
end,
},
},
}

View file

@ -1,13 +0,0 @@
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin",
},
},
}

View file

@ -0,0 +1,8 @@
return {
{ import = "plugins.mod.nvim-cmp" },
{
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" },
},
{ "rafamadriz/friendly-snippets" }
}

View file

@ -1,68 +0,0 @@
return {
{
"nvimdev/dashboard-nvim",
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
opts = function()
local logo = [[
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = "", key = "f" },
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = "", key = "r" },
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = "", key = "g" },
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return {
"⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms",
}
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- open dashboard after closing lazy
if vim.o.filetype == "lazy" then
vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()),
once = true,
callback = function()
vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end,
})
end
return opts
end,
},
}

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",
},
},
},
}

View file

@ -0,0 +1,5 @@
return {
{ import = "plugins.mod.auto-session" },
{ import = "plugins.mod.nvim-tree" },
{ "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
}

View file

@ -0,0 +1,22 @@
-- Entry point of the plugin manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ import = "plugins.appearance" },
{ import = "plugins.completion" },
{ import = "plugins.fileutils" },
{ import = "plugins.lsp" },
{ import = "plugins.syntax" },
{ import = "plugins.misc" },
})

View file

@ -1,4 +0,0 @@
return {
"NoahTheDuke/vim-just",
ft = { "just" },
}

View file

@ -0,0 +1,21 @@
return {
{ import = "plugins.mod.lspconfig" },
{ "williamboman/mason.nvim", config = true },
{
"williamboman/mason-lspconfig.nvim",
lazy = false,
dependencies = {
{ "williamboman/mason.nvim" },
{ "neovim/nvim-lspconfig" },
},
config = function()
local mason_lspconfig = require("mason-lspconfig")
local servers = require("config.servers")
mason_lspconfig.setup({
ensure_installed = servers,
})
end
},
}

View file

@ -0,0 +1,22 @@
return {
{ 'wakatime/vim-wakatime', lazy = false },
{ 'epwalsh/obsidian.nvim', lazy = true },
{
"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)",
},
},
}
}

View file

@ -0,0 +1,59 @@
-- alpha-nvim.lua
return {
{
'goolord/alpha-nvim',
dependencies = {
-- 'echasnovski/mini.icons',
-- 'nvim-lua/plenary.nvim'
},
config = function ()
local alpha = require'alpha'
local dashboard = require'alpha.themes.dashboard'
dashboard.section.header.val = {
" ",
"================= =============== =============== ======== ========",
"\\\\ . . . . . . .\\\\ //. . . . . . .\\\\ //. . . . . . .\\\\ \\\\. . .\\\\// . . //",
"||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\\/ . . .||",
"|| . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||",
"||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||",
"|| . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\\ . . . . ||",
"||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\\_ . .|. .||",
"|| . _|| || || || || ||_ . || || . _|| || || || |\\ `-_/| . ||",
"||_-' || .|/ || || \\|. || `-_|| ||_-' || .|/ || || | \\ / |-_.||",
"|| ||_-' || || `-_|| || || ||_-' || || | \\ / | `||",
"|| `' || || `' || || `' || || | \\ / | ||",
"|| .===' `===. .==='.`===. .===' /==. | \\/ | ||",
"|| .==' \\_|-_ `===. .===' _|_ `===. .===' _-|/ `== \\/ | ||",
"|| .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \\/ | ||",
"|| .==' _-' `-__\\._-' `-_./__-' `' |. /| | ||",
"||.==' _-' `' | /==.||",
"==' _-' j s 0 n y N E O V I M \\/ `==",
"\\ _-' `-_ /",
" `'' ``' ",
}
dashboard.section.buttons.val.leader = "SPC"
dashboard.section.buttons.val = {
-- leader = "SPC",
dashboard.button('c', ' 新建文件', ':enew<CR>'),
dashboard.button('SPC f f', '󰈞 查找文件', ':Telescope find_files<CR>'),
dashboard.button('SPC f h', ' 历史文件', ':Telescope oldfiles<CR>'),
dashboard.button('SPC s l', ' 加载会话', ':SessionSearch<CR>'), -- 加载会话
dashboard.button('SPC q', '󱊷 退出', ':qa<CR>'),
}
local handle = io.popen('fortune')
--- Handle the case where fortune is not installed
local fortune = ""
if handle then
fortune = handle:read("*a")
handle:close()
end
dashboard.section.footer.val = "今日 " .. os.date("%Y-%m-%d %A") .. " " .. fortune
dashboard.config.opts.noautocmd = true
-- vim.cmd[[autocmd User AlphaReady echo 'Alpha ready!']]
alpha.setup(dashboard.config)
end
};
}

View file

@ -0,0 +1,15 @@
---@diagnostic disable: undefined-doc-name
return {
{
'rmagatti/auto-session',
lazy = false,
---enables autocomplete for opts
---@module "auto-session"
---@type AutoSession.Config
opts = {
suppressed_dirs = { '~/', '~/Projects', '~/Downloads', '/' },
-- log_level = 'debug',
}
}
}

View file

@ -0,0 +1,4 @@
return {
"neovim/nvim-lspconfig",
lazy = false
}

View file

@ -0,0 +1,223 @@
-- Author: shadmansaleh
-- Credit: glepnir
local lualine = require('lualine')
-- Color table for highlights
-- stylua: ignore
local colors = {
bg = '#202328',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
-- Config
local config = {
options = {
disabled_filetypes = {
statusline = { "NvimTree", "alpha" }
},
-- Disable sections and component separators
component_separators = '',
section_separators = '',
theme = {
-- We are going to use lualine_c an lualine_x as left and
-- right section. Both are highlighted by c theme . So we
-- are just setting default looks o statusline
normal = { c = { fg = colors.fg, bg = colors.bg } },
inactive = { c = { fg = colors.fg, bg = colors.bg } },
},
},
sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
-- These will be filled later
lualine_c = {},
lualine_x = {},
},
inactive_sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
}
-- Inserts a component in lualine_c at left section
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
-- Inserts a component in lualine_x at right section
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
ins_left {
function()
return ''
end,
color = { fg = colors.blue }, -- Sets highlighting of component
padding = { left = 0, right = 1 }, -- We don't need space before this
}
ins_left {
-- mode component
function()
return ''
end,
color = function()
-- auto change color according to neovims mode
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[''] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { right = 1 },
}
ins_left {
-- filesize component
'filesize',
cond = conditions.buffer_not_empty,
}
ins_left {
'filename',
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' },
}
ins_left { 'location' }
ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } }
ins_left {
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = '', warn = '', info = '' },
diagnostics_color = {
error = { fg = colors.red },
warn = { fg = colors.yellow },
info = { fg = colors.cyan },
},
}
-- Insert mid section. You can make any number of sections in neovim :)
-- for lualine it's any number greater then 2
ins_left {
function()
return '%='
end,
}
ins_left {
-- Lsp server name .
function()
local msg = 'No Active Lsp'
local buf_ft = vim.api.nvim_get_option_value('filetype', { buf = 0 })
local clients = vim.lsp.get_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = ' LSP:',
color = { fg = '#ffffff', gui = 'bold' },
}
-- Add components to right sections
ins_right {
'o:encoding', -- option component same as &encoding in viml
fmt = string.upper, -- I'm not sure why it's upper case either ;)
cond = conditions.hide_in_width,
color = { fg = colors.green, gui = 'bold' },
}
ins_right {
'fileformat',
fmt = string.upper,
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
color = { fg = colors.green, gui = 'bold' },
}
ins_right {
'branch',
icon = '',
color = { fg = colors.violet, gui = 'bold' },
}
ins_right {
'diff',
-- Is it me or the symbol for modified us really weird
symbols = { added = '', modified = '󰝤 ', removed = '' },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
}
ins_right {
function()
return ''
end,
color = { fg = colors.blue },
padding = { left = 1 },
}
-- Now don't forget to initialize lualine
lualine.setup(config)

View file

@ -0,0 +1,71 @@
--- Available LSP goes here
--- Check https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
--- for available server and name
return {
"hrsh7th/nvim-cmp",
lazy = false,
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local cmp = require("cmp")
local lspconfig = require("lspconfig")
local capabitilies = require("cmp_nvim_lsp").default_capabilities()
local servers = require("config.servers")
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
sources = cmp.config.sources(
-- This order defines the priority of sources.
{
{ name = "nvim_lsp" },
{ name = "luasnip" },
},
{
{ name = "buffer" },
{ name = "path" },
}
),
})
local keymaps = require("config.keymaps")
local keymaps_cmp = keymaps.cmp_nvim_keymaps(cmp.mapping)
local function set_keymaps()
local mappings = {}
for _, map in ipairs(keymaps_cmp) do
mappings[map.keys] = map.cmd
end
return mappings
end
cmp.setup.mapping = cmp.mapping.preset.insert(set_keymaps())
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "cmdline" },
-- Use `path` is slow under WSL since WSL loads Windows paths
-- https://github.com/zsh-users/zsh-syntax-highlighting/issues/790
-- { name = "path" },
}
})
for _, server in ipairs(servers) do
lspconfig[server].setup({
capabilities = capabitilies,
})
end
end,
}

View file

@ -0,0 +1,41 @@
local function my_on_attach(bufnr)
-- local keymaps = require("config.keymaps")
local api = require "nvim-tree.api"
local default_mode = { "n" }
local keymaps = require("config.keymaps")
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
local function set_keymaps(maps)
for _, map in ipairs(maps) do
local mode = map.mode or default_mode
vim.keymap.set(mode, map.keys, map.cmd, map.opts)
end
end
local raw_keymaps = keymaps.nvim_tree_keymaps(api, opts)
set_keymaps(raw_keymaps)
end
return {
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
require("nvim-tree").setup {
on_attach = my_on_attach,
sync_root_with_cwd = true,
respect_buf_cwd = true,
update_focused_file = {
enable = true,
update_cwd = true,
},
}
end
}

View file

@ -1,127 +0,0 @@
return {
"nvim-neo-tree/neo-tree.nvim",
cmd = "Neotree",
keys = {
{
"<leader>fe",
function()
require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() })
end,
desc = "Explorer NeoTree (Root Dir)",
},
{
"<leader>fE",
function()
require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
end,
desc = "Explorer NeoTree (cwd)",
},
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (Root Dir)", remap = true },
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
{
"<leader>ge",
function()
require("neo-tree.command").execute({ source = "git_status", toggle = true })
end,
desc = "Git Explorer",
},
{
"<leader>be",
function()
require("neo-tree.command").execute({ source = "buffers", toggle = true })
end,
desc = "Buffer Explorer",
},
},
deactivate = function()
vim.cmd([[Neotree close]])
end,
init = function()
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
-- because `cwd` is not set up properly.
vim.api.nvim_create_autocmd("BufEnter", {
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
desc = "Start Neo-tree with directory",
once = true,
callback = function()
if package.loaded["neo-tree"] then
return
else
local stats = vim.uv.fs_stat(vim.fn.argv(0))
if stats and stats.type == "directory" then
require("neo-tree")
end
end
end,
})
end,
opts = {
sources = { "filesystem", "buffers", "git_status" },
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
filesystem = {
bind_to_cwd = false,
follow_current_file = { enabled = true },
use_libuv_file_watcher = true,
},
window = {
mappings = {
-- MARKED
["i"] = "open",
-- MARKED
["e"] = "noop",
["h"] = "close_node",
["<space>"] = "none",
["Y"] = {
function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.setreg("+", path, "c")
end,
desc = "Copy Path to Clipboard",
},
["O"] = {
function(state)
require("lazy.util").open(state.tree:get_node().path, { system = true })
end,
desc = "Open with System Application",
},
["P"] = { "toggle_preview", config = { use_float = false } },
},
},
default_component_configs = {
indent = {
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
git_status = {
symbols = {
unstaged = "󰄱",
staged = "󰱒",
},
},
},
},
config = function(_, opts)
local function on_move(data)
LazyVim.lsp.on_rename(data.source, data.destination)
end
local events = require("neo-tree.events")
opts.event_handlers = opts.event_handlers or {}
vim.list_extend(opts.event_handlers, {
{ event = events.FILE_MOVED, handler = on_move },
{ event = events.FILE_RENAMED, handler = on_move },
})
require("neo-tree").setup(opts)
vim.api.nvim_create_autocmd("TermClose", {
pattern = "*lazygit",
callback = function()
if package.loaded["neo-tree.sources.git_status"] then
require("neo-tree.sources.git_status").refresh()
end
end,
})
end,
}

View file

@ -0,0 +1,6 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
}

View file

@ -1,3 +0,0 @@
return {
{ 'wakatime/vim-wakatime', lazy = false },
}

View file

@ -1,40 +0,0 @@
local keymap = vim.keymap.set
vim.g.mapleader = " "
vim.keymap.set({ "n", "v", "", "s", "x" }, "e", "k", { desc = "move cursor ⇧" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "n", "j", { desc = "move cursor ⇩" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "h", "h", { desc = "move cursor ⇦" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "i", "l", { desc = "move cursor ⇨" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "N", "J", { desc = "Insert at the line start" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "E", "K", { desc = "Insert at the line start" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "I", "L", { desc = "Insert at the line start" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "l", "i", { desc = "Insert mode" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "L", "I", { desc = "Insert at the line start" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "k", "n", { desc = "Insert at the line start" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "K", "N", { desc = "Insert at the line start" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "j", "e", { desc = "Insert at the line start" })
vim.keymap.set({ "n", "v", "", "s", "x" }, "J", "E", { desc = "Insert at the line start" })
vim.opt.clipboard = "unnamedplus"
vim.opt.expandtab = true
vim.opt.tabstop = 5
vim.opt.shiftwidth = 4
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.wrap = true
vim.opt.scrolloff = 3
vim.opt.hlsearch = true
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.number = true
vim.opt.relativenumber = true
-- VSCode commands
keymap({ "n", "v" }, "<leader>pp", "<cmd>lua require('vscode').action('workbench.view.extension.project-manager')<CR>")
keymap({ "n", "v" }, "<leader>pP", "<cmd>lua require('vscode').action('projectManager.listProjects')<CR>")

View file

@ -1,3 +1,5 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120
indent_type = "Spaces"
indent_width = 2
column_width = 120
[sort_requires]
enabled = true