1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

36 Commits

Author SHA1 Message Date
jdhao
cb8c9208e1 update which-key conf and some mappings 2024-07-25 04:00:17 +08:00
jdhao
ce1e13e2c9 use plugin nvim-autopairs for autopair
delimitMate is not updated for a long time.
2024-07-14 05:17:49 +08:00
jdhao
2af616bb0d Update hop.nvim conf to support Chinese 2024-06-26 03:33:24 +08:00
jdhao
3694d3c237 Update config for GitSigns 2024-06-26 03:25:01 +08:00
jdhao
69d8543495 remove emmylua since neovim has builtin annotation
Seee also this https://github.com/neovim/neovim/pull/24493
2024-05-20 22:09:07 +02:00
jdhao
be3d134c37 use vim.uv instead of vim.loop 2024-05-20 21:52:52 +02:00
jdhao
601396f700 upgrade neovim to latest stable
The way to compare versions are changed due to a bug in comparing
versions in the neovim core: https://github.com/neovim/neovim/issues/28782
2024-05-20 21:33:38 +02:00
jdhao
e462ebcbcc Enable treesitter folding for Python and Lua 2024-05-08 03:46:45 +08:00
jdhao
2f8482639d update some mappings
1. fix a typo in gJ mapping when setting the mark, the correct syntax is
   `mz` (set mark `z`), not `zm`

2. fix bug with `iB` text object: previously `viB` does not work as
   expected, because it does not select the entire buffer as expected.
   After much investigation, I found it is because the `<cmd>` mapping
   argument. If we use `<cmd>` argument for mapping, the mode does not
   change. So if we use `viB`, inititally we are still in visual mode.
   Later in the implementation, when we use `` normal! `<V`>  `` to
   select the entire buffer, it interferes with original visual mode. As
   a result, the entire buffer is not selected. In the text obj
   implementation, we can use `exe "normal! \<Esc>"` to clear the visual
   mode and make `viB`, but this is not ideal. I think it is eaiser to
   just not use the `<cmd>` argument and use `:<C-U>` instead.
2024-02-28 06:36:05 +08:00
jdhao
050eacaee2 Stop showing percent location
The percent location is useless and just noise.
2024-02-23 06:11:21 +08:00
jdhao
01bc4b40d3 update used plugins 2024-02-02 03:52:26 +08:00
jdhao
c06d46e84d remove lazylock
I don't use this feature at all.
2024-02-02 03:43:55 +08:00
jdhao
7cf70f31af Update colorscheme conf
1. remove some colorscheme that doesn't work well with Markdown
2. change how the colorscheme conf is organized.
2024-02-02 03:40:11 +08:00
jdhao
8416508686 Enable nvim-tree to open dir during startup
Now when you open a directory when starting nvim, nvim-tree will be
opened to handle the directory correctly, see also issue #257.
2024-01-07 15:24:47 +01:00
jdhao
df9491b05b bump neovim version to 0.9.5 2024-01-07 14:45:29 +01:00
jdhao
17d2e3ab3e Deal with other variant of unix timestamp 2023-10-21 00:53:15 +02:00
jdhao
2c9948300d Add diffview.nvim for viewing diffs 2023-10-18 22:10:11 +02:00
jdhao
dfaa3d97a5 update plugin spec 2023-10-12 23:26:43 +02:00
jdhao
8d74fcb75c Remove obsolete options for nvim-tree 2023-10-11 20:43:24 +02:00
jdhao
b1f0ef63ef Rename vimscript conf directory 2023-10-11 20:41:25 +02:00
jdhao
54ca6d4191 update to nvim 0.9.4 2023-10-11 20:35:50 +02:00
jdhao
97af59e670 remove obsolete option for indent-blankline 2023-10-03 15:14:34 +02:00
jdhao
4d8ef868ad upgrade indent-blankline to v3 2023-09-28 23:41:42 +02:00
jdhao
3137850db6 Show Py virtual env on statusline 2023-09-28 09:42:27 +02:00
jdhao
eccdc62f38 remove colorschemes rose-pine 2023-09-22 19:38:28 +02:00
jdhao
ad483a7dc0 Use the matained fork of hop.nvim 2023-09-16 14:47:43 +02:00
jdhao
6df27d1c22 upgrade to neovim 0.9.2 2023-09-16 14:26:38 +02:00
jdhao
7f6627cfa1 update plugin conf for Lazy.nvim 2023-09-10 22:16:16 +02:00
jdhao
7ff11a9760 update plugin lazy loading events 2023-09-05 00:22:02 +02:00
jdhao
cc4688d089 Loosen the version check condition
Other version of nvim can still run this config, but should use with
care.
2023-09-01 21:39:08 +02:00
jdhao
8a1b3193a4 fix bufferline loading issue 2023-09-01 21:27:13 +02:00
jdhao
e92362041c fix hlslens issue when no pattern is found
The captured error message is not correct before.
2023-09-01 21:22:22 +02:00
jdhao
63ff776758 fix loading order of nvim-cmp and nvim-lsp 2023-09-01 20:52:46 +02:00
jdhao
41c8c81f21 update spell 2023-09-01 01:08:41 +02:00
jdhao
997c6286df Optimize plugin loading speed 2023-09-01 01:07:16 +02:00
jdhao
359621b126 fix multi visual line delete issue
For TextYankPost event, it includes both yank and delete, we should only
restore cursor position for yank, not for delete. Otherwise, it messes
up with text deletion when you visually select multiple lines and delete
them. See also issue reported here: https://github.com/jdhao/nvim-config/pull/222#issuecomment-1698634645
2023-09-01 00:26:08 +02:00
23 changed files with 271 additions and 369 deletions

View File

@@ -13,7 +13,7 @@
<img alt="Latest release" src="https://img.shields.io/github/v/release/jdhao/nvim-config" /> <img alt="Latest release" src="https://img.shields.io/github/v/release/jdhao/nvim-config" />
</a> </a>
<a href="https://github.com/neovim/neovim/releases/tag/stable"> <a href="https://github.com/neovim/neovim/releases/tag/stable">
<img src="https://img.shields.io/badge/Neovim-0.9.1-blueviolet.svg?style=flat-square&logo=Neovim&logoColor=green" alt="Neovim minimum version"/> <img src="https://img.shields.io/badge/Neovim-0.9.5-blueviolet.svg?style=flat-square&logo=Neovim&logoColor=green" alt="Neovim minimum version"/>
</a> </a>
<a href="https://github.com/jdhao/nvim-config/search?l=vim-script"> <a href="https://github.com/jdhao/nvim-config/search?l=vim-script">
<img src="https://img.shields.io/github/languages/top/jdhao/nvim-config" alt="Top languages"/> <img src="https://img.shields.io/github/languages/top/jdhao/nvim-config" alt="Top languages"/>
@@ -21,8 +21,8 @@
<a href="https://github.com/jdhao/nvim-config/graphs/commit-activity"> <a href="https://github.com/jdhao/nvim-config/graphs/commit-activity">
<img src="https://img.shields.io/github/commit-activity/m/jdhao/nvim-config?style=flat-square" /> <img src="https://img.shields.io/github/commit-activity/m/jdhao/nvim-config?style=flat-square" />
</a> </a>
<a href="https://github.com/jdhao/nvim-config/releases/tag/v0.9.1"> <a href="https://github.com/jdhao/nvim-config/releases/tag/v0.9.5">
<img src="https://img.shields.io/github/commits-since/jdhao/nvim-config/v0.9.1?style=flat-square" /> <img src="https://img.shields.io/github/commits-since/jdhao/nvim-config/v0.9.5?style=flat-square" />
</a> </a>
<a href="https://github.com/jdhao/nvim-config/graphs/contributors"> <a href="https://github.com/jdhao/nvim-config/graphs/contributors">
<img src="https://img.shields.io/github/contributors/jdhao/nvim-config?style=flat-square" /> <img src="https://img.shields.io/github/contributors/jdhao/nvim-config?style=flat-square" />
@@ -64,7 +64,7 @@ and how to set up on different platforms (Linux, macOS, and Windows).
+ Better escaping from insert mode via [better-escape.vim](https://github.com/nvim-zh/better-escape.vim). + Better escaping from insert mode via [better-escape.vim](https://github.com/nvim-zh/better-escape.vim).
+ Ultra-fast project-wide fuzzy searching via [LeaderF](https://github.com/Yggdroot/LeaderF). + Ultra-fast project-wide fuzzy searching via [LeaderF](https://github.com/Yggdroot/LeaderF).
+ Faster code commenting via [vim-commentary](https://github.com/tpope/vim-commentary). + Faster code commenting via [vim-commentary](https://github.com/tpope/vim-commentary).
+ Faster matching pair insertion and jump via [delimitMate](https://github.com/Raimondi/delimitMate). + Faster matching pair insertion and jump via [nvim-autopairs](https://github.com/windwp/nvim-autopairs).
+ Smarter and faster matching pair management (add, replace or delete) via [vim-sandwich](https://github.com/machakann/vim-sandwich). + Smarter and faster matching pair management (add, replace or delete) via [vim-sandwich](https://github.com/machakann/vim-sandwich).
+ Fast buffer jump via [hop.nvim](https://github.com/phaazon/hop.nvim). + Fast buffer jump via [hop.nvim](https://github.com/phaazon/hop.nvim).
+ Powerful snippet insertion via [Ultisnips](https://github.com/SirVer/ultisnips). + Powerful snippet insertion via [Ultisnips](https://github.com/SirVer/ultisnips).

View File

@@ -34,6 +34,3 @@ function s:create_term_buf(_type, size) abort
endif endif
execute 'resize ' . a:size execute 'resize ' . a:size
endfunction endfunction
" For delimitMate
let b:delimitMate_matchpairs = "(:),[:],{:}"

View File

@@ -4,5 +4,6 @@ set formatoptions-=r
nnoremap <buffer><silent> <F9> :luafile %<CR> nnoremap <buffer><silent> <F9> :luafile %<CR>
" For delimitMate " Use nvim-treesitter for folding
let b:delimitMate_matchpairs = "(:),[:],{:}" set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()

View File

@@ -13,5 +13,6 @@ set softtabstop=4 " number of spaces in tab when editing
set shiftwidth=4 " number of spaces to use for autoindent set shiftwidth=4 " number of spaces to use for autoindent
set expandtab " expand tab to spaces so that tabs are spaces set expandtab " expand tab to spaces so that tabs are spaces
" For delimitMate " Use nvim-treesitter for folding
let b:delimitMate_matchpairs = "(:),[:],{:}" set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()

View File

@@ -128,11 +128,22 @@ endfunction
" Output current time or unix timestamp in human-readable format. " Output current time or unix timestamp in human-readable format.
function! utils#iso_time(timestamp) abort function! utils#iso_time(timestamp) abort
if a:timestamp " Get current datetime
return strftime('%Y-%m-%d %H:%M:%S%z', a:timestamp) if !a:timestamp
return strftime('%Y-%m-%d %H:%M:%S%z')
endif endif
return strftime('%Y-%m-%d %H:%M:%S%z') " this timestamp in expressed in milliseconds
if len(a:timestamp) == 13
let l:timestamp = a:timestamp[:-4]
" this timestamp in expressed in microseconds
elseif len(a:timestamp) == 16
let l:timestamp = a:timestamp[:-7]
else
let l:timestamp = a:timestamp
endif
return strftime('%Y-%m-%d %H:%M:%S%z', l:timestamp)
endfunction endfunction
" Check if we are inside a Git repo. " Check if we are inside a Git repo.

View File

@@ -11,19 +11,19 @@
-- StackOverflow: https://stackoverflow.com/users/6064933/jdhao -- StackOverflow: https://stackoverflow.com/users/6064933/jdhao
vim.loader.enable() vim.loader.enable()
local api = vim.api
local version = vim.version local version = vim.version
-- check if we have the latest stable version of nvim -- check if we have the latest stable version of nvim
local expected_ver = "0.9.1" local expected_ver = "0.10.0"
local ev = version.parse(expected_ver) local ev = version.parse(expected_ver)
local actual_ver = version() local actual_ver = version()
if version.cmp(ev, actual_ver) ~= 0 then local result = version.cmp(ev, {actual_ver.major, actual_ver.minor, actual_ver.patch})
if result ~= 0 then
local _ver = string.format("%s.%s.%s", actual_ver.major, actual_ver.minor, actual_ver.patch) local _ver = string.format("%s.%s.%s", actual_ver.major, actual_ver.minor, actual_ver.patch)
local msg = string.format("Unsupported nvim version: expect %s, but got %s instead!", expected_ver, _ver) local msg = string.format("Expect nvim %s, but got %s instead. Use at your own risk!", expected_ver, _ver)
api.nvim_err_writeln(msg) vim.api.nvim_err_writeln(msg)
return
end end
local core_conf_files = { local core_conf_files = {
@@ -35,10 +35,11 @@ local core_conf_files = {
"colorschemes.lua", -- colorscheme settings "colorschemes.lua", -- colorscheme settings
} }
local viml_conf_dir = vim.fn.stdpath("config") .. "/viml_conf"
-- source all the core config files -- source all the core config files
for _, file_name in ipairs(core_conf_files) do for _, file_name in ipairs(core_conf_files) do
if vim.endswith(file_name, 'vim') then if vim.endswith(file_name, 'vim') then
local path = string.format("%s/core/%s", vim.fn.stdpath("config"), file_name) local path = string.format("%s/%s", viml_conf_dir, file_name)
local source_cmd = "source " .. path local source_cmd = "source " .. path
vim.cmd(source_cmd) vim.cmd(source_cmd)
else else

View File

@@ -1,88 +0,0 @@
{
"LeaderF": { "branch": "master", "commit": "3ded37f92807d8c6ad831d5af2c4ff22bfd32fc8" },
"asyncrun.vim": { "branch": "master", "commit": "42385d54b8546c163b946fd50eed2103ef7993c9" },
"better-escape.vim": { "branch": "master", "commit": "6b16a45a839727977277f6ab11bded63e9ed86bb" },
"bufferline.nvim": { "branch": "main", "commit": "417b303328118b6d836ae330142e88771c48a8a3" },
"catppuccin": { "branch": "main", "commit": "2e3e5ebcdc24ef0d5b14a0a999dbbe7936512c46" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-ultisnips": { "branch": "main", "commit": "24bca5c3e137b28cd87442d4fc51a2b312dd99cc" },
"cmp-omni": { "branch": "main", "commit": "9436e6cdd7c5dfa24a99a60d9280b24dbdea3649" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"committia.vim": { "branch": "master", "commit": "0b4df1a7f48ffbc23b009bd14d58ee1be541917c" },
"dashboard-nvim": { "branch": "master", "commit": "9134d7befd50ff920ede5b0f7d6c3dbb9f7c0ecb" },
"delimitMate": { "branch": "master", "commit": "537a1da0fa5eeb88640425c37e545af933c56e1b" },
"dressing.nvim": { "branch": "master", "commit": "c7b035de7f91bb6b62b4308f105c56d1a968b8c5" },
"edge": { "branch": "master", "commit": "a4fd4f458331d42677d992f428235c491b2016aa" },
"emmylua-nvim": { "branch": "master", "commit": "60178ca58f75f5ea68a20205895ea50f5593f205" },
"everforest": { "branch": "master", "commit": "83b666410d7ae0eccf96dbbe3b4b6ac5b8172d38" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"firenvim": { "branch": "master", "commit": "138424db463e6c0e862a05166a4ccc781cd7c19d" },
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"gitsigns.nvim": { "branch": "main", "commit": "d8590288417fef2430f85bc8b312fae8b1cf2c40" },
"gruvbox-material": { "branch": "master", "commit": "b5f8c6a6c1cda630c53b061b765068a0898d47a3" },
"hop.nvim": { "branch": "master", "commit": "03f0434869f1f38868618198b5f4f2ab6d39aef2" },
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
"kanagawa.nvim": { "branch": "master", "commit": "0a24e504a3a278849ad0aef31cd6dd24c73ca3db" },
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"material.nvim": { "branch": "main", "commit": "1ecaa2d065a1ea308bd7702a77c2bf35ede8f536" },
"monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" },
"neoformat": { "branch": "master", "commit": "0c285d7a7c06a6ee88db70871a274797693fce42" },
"nightfox.nvim": { "branch": "main", "commit": "a48f6d9a0273101df76eb25d2f5477baa277f935" },
"nord.nvim": { "branch": "master", "commit": "fab04b2dd4b64f4b1763b9250a8824d0b5194b8f" },
"nvim-bqf": { "branch": "main", "commit": "c920a55c6153766bd909e474b7feffa9739f07e8" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-hlslens": { "branch": "main", "commit": "f0281591a59e95400babf61a96e59ba20e5c9533" },
"nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" },
"nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
"nvim-tree.lua": { "branch": "master", "commit": "00741206c2df9c4b538055def19b99790f0c95c8" },
"nvim-treesitter": { "branch": "master", "commit": "08c830f625eb93db9c89c5e946e8eea7111bd568" },
"nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" },
"onedark.nvim": { "branch": "master", "commit": "7bd3558c17045b95c961d28861c1b3bd9bdc992a" },
"onedarkpro.nvim": { "branch": "main", "commit": "c81dff789f7623c431d1f43cf334237e52bbfd61" },
"open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" },
"plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" },
"rose-pine": { "branch": "main", "commit": "e29002cbee4854a9c8c4b148d8a52fae3176070f" },
"sonokai": { "branch": "master", "commit": "17308ee6d9c764bfc1e0fa97213e7a99701b4144" },
"tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" },
"targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" },
"telescope-symbols.nvim": { "branch": "master", "commit": "f2060117d965df4a626f068a4ebbd8ee051aa076" },
"telescope.nvim": { "branch": "master", "commit": "207285ccec21b69996a4d3bcfa59df35d48610e8" },
"ultisnips": { "branch": "master", "commit": "24a3ebb36687b6d59a19d63173713575b486d739" },
"unicode.vim": { "branch": "master", "commit": "c8aa12b1e2e1b6254885b12bdb239ce6c885fdb1" },
"vim-auto-save": { "branch": "master", "commit": "2e3e54ea4c0fc946c21b0a4ee4c1c295ba736ee8" },
"vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" },
"vim-conflicted": { "branch": "master", "commit": "068c320796f807ac4961618e3e62316773803996" },
"vim-eunuch": { "branch": "master", "commit": "67f3dd32b4dcd1c427085f42ff5f29c7adc645c6" },
"vim-flog": { "branch": "master", "commit": "2cfa2e9d67a06a75d3d4e965c6bad558ff41e488" },
"vim-fugitive": { "branch": "master", "commit": "572c8510123cbde02e8a1dafcd376c98e1e13f43" },
"vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" },
"vim-highlighturl": { "branch": "master", "commit": "012fee983e03913db6ba6393307eac434999b896" },
"vim-indent-object": { "branch": "master", "commit": "5c5b24c959478929b54a9e831a8e2e651a465965" },
"vim-markdown": { "branch": "master", "commit": "cc82d88e2a791f54d2b6e2b26e41f743351ac947" },
"vim-markdownfootnotes": { "branch": "master", "commit": "2b288149f48cfaf7465d25bb094ed62898f5e5b0" },
"vim-matchup": { "branch": "master", "commit": "582cbc8c2dc311deb7a03f7d505d52544c36d4b6" },
"vim-mundo": { "branch": "master", "commit": "b53d35fb5ca9923302b9ef29e618ab2db4cc675e" },
"vim-obsession": { "branch": "master", "commit": "fe9d3e1a9a50171e7d316a52e1e56d868e4c1fe5" },
"vim-python-pep8-indent": { "branch": "master", "commit": "60ba5e11a61618c0344e2db190210145083c91f8" },
"vim-pythonsense": { "branch": "master", "commit": "9200a57629c904ed2ab8c9b2e8c5649d311794ba" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-sandwich": { "branch": "master", "commit": "c5a2cc438ce6ea2005c556dc833732aa53cae21a" },
"vim-scriptease": { "branch": "master", "commit": "18511d389675d773994215ddb572ccdc2b72f52b" },
"vim-snippets": { "branch": "master", "commit": "d37486881a0a771b844a235bc3e025046088690d" },
"vim-swap": { "branch": "master", "commit": "9358bfdc5e377aa13e7c2c2dd8699ba32b0dcf83" },
"vim-tmux": { "branch": "master", "commit": "cfe76281efc29890548cf9eedd42ad51c7a1faf0" },
"vim-toml": { "branch": "main", "commit": "d36caa6b1cf508a4df1c691f915572fc02143258" },
"vim-xkbswitch": { "branch": "master", "commit": "42b55bfec8f6dbd715135ce582a6f769831face1" },
"vimtex": { "branch": "master", "commit": "534fd725f2475a9083b032e402c7e73b8a3fc6bb" },
"vista.vim": { "branch": "master", "commit": "f925e481bba7cd5451fb8bca9a6ecfc2bf1f2858" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
"whitespace.nvim": { "branch": "master", "commit": "f0fc9e9c4ce3f7d2166e9e5a069b64b9ca4a3f15" },
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" },
"yanky.nvim": { "branch": "main", "commit": "95c2f006ea6eaed2b2d8b8b4943b8fcf13faf03f" },
"zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" }
}

View File

@@ -6,52 +6,23 @@ local M = {}
-- Colorscheme to its directory name mapping, because colorscheme repo name is not necessarily -- Colorscheme to its directory name mapping, because colorscheme repo name is not necessarily
-- the same as the colorscheme name itself. -- the same as the colorscheme name itself.
M.colorscheme2dir = { M.colorscheme_conf = {
onedark = "onedark.nvim", onedark = function()
edge = "edge",
sonokai = "sonokai",
gruvbox_material = "gruvbox-material",
nord = "nord.nvim",
everforest = "everforest",
nightfox = "nightfox.nvim",
kanagawa = "kanagawa.nvim",
catppuccin = "catppuccin",
rose_pine = "rose-pine",
onedarkpro = "onedarkpro.nvim",
monokai = "monokai.nvim",
material = "material.nvim",
}
M.gruvbox8 = function()
-- Italic options should be put before colorscheme setting,
-- see https://github.com/morhetz/gruvbox/wiki/Terminal-specific#1-italics-is-disabled
vim.g.gruvbox_italics = 1
vim.g.gruvbox_italicize_strings = 1
vim.g.gruvbox_filetype_hi_groups = 1
vim.g.gruvbox_plugin_hi_groups = 1
vim.cmd([[colorscheme gruvbox8_hard]])
end
M.onedark = function()
vim.cmd([[colorscheme onedark]]) vim.cmd([[colorscheme onedark]])
end end,
edge = function()
M.edge = function()
vim.g.edge_enable_italic = 1 vim.g.edge_enable_italic = 1
vim.g.edge_better_performance = 1 vim.g.edge_better_performance = 1
vim.cmd([[colorscheme edge]]) vim.cmd([[colorscheme edge]])
end end,
sonokai = function()
M.sonokai = function()
vim.g.sonokai_enable_italic = 1 vim.g.sonokai_enable_italic = 1
vim.g.sonokai_better_performance = 1 vim.g.sonokai_better_performance = 1
vim.cmd([[colorscheme sonokai]]) vim.cmd([[colorscheme sonokai]])
end end,
gruvbox_material = function()
M.gruvbox_material = function()
-- foreground option can be material, mix, or original -- foreground option can be material, mix, or original
vim.g.gruvbox_material_foreground = "material" vim.g.gruvbox_material_foreground = "material"
--background option can be hard, medium, soft --background option can be hard, medium, soft
@@ -60,69 +31,38 @@ M.gruvbox_material = function()
vim.g.gruvbox_material_better_performance = 1 vim.g.gruvbox_material_better_performance = 1
vim.cmd([[colorscheme gruvbox-material]]) vim.cmd([[colorscheme gruvbox-material]])
end end,
everforest = function()
M.nord = function()
vim.cmd([[colorscheme nord]])
end
M.doom_one = function()
vim.cmd([[colorscheme doom-one]])
end
M.everforest = function()
vim.g.everforest_enable_italic = 1 vim.g.everforest_enable_italic = 1
vim.g.everforest_better_performance = 1 vim.g.everforest_better_performance = 1
vim.cmd([[colorscheme everforest]]) vim.cmd([[colorscheme everforest]])
end end,
nightfox = function()
M.nightfox = function()
vim.cmd([[colorscheme nordfox]]) vim.cmd([[colorscheme nordfox]])
end end,
catppuccin = function()
M.kanagawa = function()
vim.cmd([[colorscheme kanagawa]])
end
M.catppuccin = function()
-- available option: latte, frappe, macchiato, mocha -- available option: latte, frappe, macchiato, mocha
vim.g.catppuccin_flavour = "frappe" vim.g.catppuccin_flavour = "frappe"
require("catppuccin").setup() require("catppuccin").setup()
vim.cmd([[colorscheme catppuccin]]) vim.cmd([[colorscheme catppuccin]])
end end,
onedarkpro = function()
M.rose_pine = function()
require('rose-pine').setup({
--- @usage 'main' | 'moon'
dark_variant = 'moon',
})
-- set colorscheme after options
vim.cmd('colorscheme rose-pine')
end
M.onedarkpro = function()
-- set colorscheme after options -- set colorscheme after options
vim.cmd('colorscheme onedark_vivid') vim.cmd('colorscheme onedark_vivid')
end end,
material = function()
M.monokai = function()
vim.cmd('colorscheme monokai_pro')
end
M.material = function ()
vim.g.material_style = "oceanic" vim.g.material_style = "oceanic"
vim.cmd('colorscheme material') vim.cmd('colorscheme material')
end end,
}
--- Use a random colorscheme from the pre-defined list of colorschemes. --- Use a random colorscheme from the pre-defined list of colorschemes.
M.rand_colorscheme = function() M.rand_colorscheme = function()
local colorscheme = utils.rand_element(vim.tbl_keys(M.colorscheme2dir)) local colorscheme = utils.rand_element(vim.tbl_keys(M.colorscheme_conf))
if not vim.tbl_contains(vim.tbl_keys(M), colorscheme) then if not vim.tbl_contains(vim.tbl_keys(M.colorscheme_conf), colorscheme) then
local msg = "Invalid colorscheme: " .. colorscheme local msg = "Invalid colorscheme: " .. colorscheme
vim.notify(msg, vim.log.levels.ERROR, { title = "nvim-config" }) vim.notify(msg, vim.log.levels.ERROR, { title = "nvim-config" })
@@ -130,7 +70,7 @@ M.rand_colorscheme = function()
end end
-- Load the colorscheme and its settings -- Load the colorscheme and its settings
M[colorscheme]() M.colorscheme_conf[colorscheme]()
if vim.g.logging_level == "debug" then if vim.g.logging_level == "debug" then
local msg = "Colorscheme: " .. colorscheme local msg = "Colorscheme: " .. colorscheme

View File

@@ -2,11 +2,11 @@ local gs = require("gitsigns")
gs.setup { gs.setup {
signs = { signs = {
add = { hl = "GitSignsAdd", text = "+", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, add = { text = "+" },
change = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, change = { text = "~" },
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, delete = { text = "_" },
topdelete = { hl = "GitSignsDelete", text = "", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, topdelete = { text = "" },
changedelete = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, changedelete = { text = "" },
}, },
word_diff = true, word_diff = true,
on_attach = function(bufnr) on_attach = function(bufnr)

View File

@@ -12,10 +12,11 @@ local activate_hlslens = function(direction)
local cmd = string.format("normal! %s%szzzv", vim.v.count1, direction) local cmd = string.format("normal! %s%szzzv", vim.v.count1, direction)
local status, msg = pcall(vim.cmd, cmd) local status, msg = pcall(vim.cmd, cmd)
-- Deal with the case that there is no such pattern in current buffer.
if not status then if not status then
-- 13 is the index where real error message starts local start_idx, _ = string.find(msg, 'E486', 1, true)
msg = msg:sub(13) local msg_part = string.sub(msg, start_idx)
api.nvim_err_writeln(msg) api.nvim_err_writeln(msg_part)
return return
end end

View File

@@ -1,21 +1,28 @@
local api = vim.api local api = vim.api
local exclude_ft = { "help", "git", "markdown", "snippets", "text", "gitconfig", "alpha" } local exclude_ft = { "help", "git", "markdown", "snippets", "text", "gitconfig", "alpha", "dashboard" }
require("indent_blankline").setup {
-- U+2502 may also be a good choice, it will be on the middle of cursor. require("ibl").setup {
-- U+250A is also a good choice indent = {
-- -- U+2502 may also be a good choice, it will be on the middle of cursor.
-- -- U+250A is also a good choice
char = "", char = "",
show_end_of_line = false, },
disable_with_nolist = true, scope = {
buftype_exclude = { "terminal" }, show_start = false,
filetype_exclude = exclude_ft, show_end = false,
},
exclude = {
filetypes = exclude_ft,
buftypes = { "terminal" },
},
} }
local gid = api.nvim_create_augroup("indent_blankline", { clear = true }) local gid = api.nvim_create_augroup("indent_blankline", { clear = true })
api.nvim_create_autocmd("InsertEnter", { api.nvim_create_autocmd("InsertEnter", {
pattern = "*", pattern = "*",
group = gid, group = gid,
command = "IndentBlanklineDisable", command = "IBLDisable",
}) })
api.nvim_create_autocmd("InsertLeave", { api.nvim_create_autocmd("InsertLeave", {
@@ -23,7 +30,7 @@ api.nvim_create_autocmd("InsertLeave", {
group = gid, group = gid,
callback = function() callback = function()
if not vim.tbl_contains(exclude_ft, vim.bo.filetype) then if not vim.tbl_contains(exclude_ft, vim.bo.filetype) then
vim.cmd([[IndentBlanklineEnable]]) vim.cmd([[IBLEnable]])
end end
end, end,
}) })

View File

@@ -234,7 +234,7 @@ if utils.executable("lua-language-server") then
-- see also https://github.com/LuaLS/lua-language-server/wiki/Libraries#link-to-workspace . -- see also https://github.com/LuaLS/lua-language-server/wiki/Libraries#link-to-workspace .
-- Lua-dev.nvim also has similar settings for lua ls, https://github.com/folke/neodev.nvim/blob/main/lua/neodev/luals.lua . -- Lua-dev.nvim also has similar settings for lua ls, https://github.com/folke/neodev.nvim/blob/main/lua/neodev/luals.lua .
library = { library = {
fn.stdpath("data") .. "/lazy/emmylua-nvim", vim.env.VIMRUNTIME,
fn.stdpath("config"), fn.stdpath("config"),
}, },
maxPreload = 2000, maxPreload = 2000,

View File

@@ -4,15 +4,14 @@ local nvim_tree = require("nvim-tree")
nvim_tree.setup { nvim_tree.setup {
auto_reload_on_write = true, auto_reload_on_write = true,
disable_netrw = false, disable_netrw = false,
hijack_cursor = false,
hijack_netrw = true, hijack_netrw = true,
hijack_cursor = false,
hijack_unnamed_buffer_when_opening = false, hijack_unnamed_buffer_when_opening = false,
open_on_tab = false, open_on_tab = false,
sort_by = "name", sort_by = "name",
update_cwd = false, update_cwd = false,
view = { view = {
width = 30, width = 30,
hide_root_folder = false,
side = "left", side = "left",
preserve_window_proportions = false, preserve_window_proportions = false,
number = false, number = false,

View File

@@ -1,13 +1,10 @@
vim.cmd([[hi HopNextKey cterm=bold ctermfg=176 gui=bold guibg=#ff00ff guifg=#ffffff]])
vim.cmd([[hi HopNextKey1 cterm=bold ctermfg=176 gui=bold guibg=#ff00ff guifg=#ffffff]])
vim.cmd([[hi HopNextKey2 cterm=bold ctermfg=176 gui=bold guibg=#ff00ff guifg=#ffffff]])
local keymap = vim.keymap local keymap = vim.keymap
local hop = require("hop") local hop = require("hop")
hop.setup { hop.setup {
case_insensitive = true, case_insensitive = true,
char2_fallback_key = "<CR>", char2_fallback_key = "<CR>",
quit_key = "<Esc>", quit_key = "<Esc>",
match_mappings = { "zh_sc" }
} }
keymap.set({ "n", "v", "o" }, "f", "", { keymap.set({ "n", "v", "o" }, "f", "", {
@@ -18,3 +15,14 @@ keymap.set({ "n", "v", "o" }, "f", "", {
end, end,
desc = "nvim-hop char2", desc = "nvim-hop char2",
}) })
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "*",
callback = function()
vim.cmd([[
hi HopNextKey cterm=bold ctermfg=176 gui=bold guibg=#ff00ff guifg=#ffffff
hi HopNextKey1 cterm=bold ctermfg=176 gui=bold guibg=#ff00ff guifg=#ffffff
hi HopNextKey2 cterm=bold ctermfg=176 gui=bold guibg=#ff00ff guifg=#ffffff
]])
end
})

View File

@@ -97,6 +97,27 @@ local diff = function()
return info return info
end end
local virtual_env = function()
-- only show virtual env for Python
if vim.bo.filetype ~= 'python' then
return ""
end
local conda_env = os.getenv('CONDA_DEFAULT_ENV')
local venv_path = os.getenv('VIRTUAL_ENV')
if venv_path == nil then
if conda_env == nil then
return ""
else
return string.format(" %s (conda)", conda_env)
end
else
local venv_name = vim.fn.fnamemodify(venv_path, ':t')
return string.format(" %s (venv)", venv_name)
end
end
require("lualine").setup { require("lualine").setup {
options = { options = {
icons_enabled = true, icons_enabled = true,
@@ -116,6 +137,10 @@ require("lualine").setup {
"diff", "diff",
source = diff, source = diff,
}, },
{
virtual_env,
color = { fg = 'black', bg = "#F1CA81" }
}
}, },
lualine_c = { lualine_c = {
"filename", "filename",
@@ -147,7 +172,6 @@ require("lualine").setup {
}, },
lualine_y = { lualine_y = {
"location", "location",
"progress",
}, },
lualine_z = { lualine_z = {
{ {

View File

@@ -1,60 +1,6 @@
require("which-key").setup { require("which-key").setup {
plugins = { preset = "modern",
marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
spelling = {
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
suggestions = 9, -- how many suggestions should be shown in the list?
},
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created
presets = {
operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion
motions = true, -- adds help for motions
text_objects = true, -- help for text objects triggered after entering an operator
windows = true, -- default bindings on <c-w>
nav = true, -- misc bindings to work with windows
z = true, -- bindings for folds, spelling and others prefixed with z
g = true, -- bindings for prefixed with g
},
},
-- add operators that will trigger motion and text object completion
-- to enable all native operators, set the preset / operators plugin above
operators = { gc = "Comments" },
key_labels = {
-- override the label used to display some keys. It doesn't effect WK in any other way.
-- For example:
-- ["<space>"] = "SPC",
-- ["<cr>"] = "RET",
-- ["<tab>"] = "TAB",
},
icons = { icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo mappings = false
separator = "", -- symbol used between a key and it's label }
group = "+", -- symbol prepended to a group
},
window = {
border = "none", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 0, 0, 0, 0 }, -- extra window margin [top, right, bottom, left]
padding = { 1, 0, 1, 0 }, -- extra window padding [top, right, bottom, left]
},
layout = {
height = { min = 1, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 1, -- spacing between columns
align = "center", -- align columns left, center or right
},
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
show_help = true, -- show help message on the command line when the popup is visible
triggers = "auto", -- automatically setup triggers
-- triggers = {"<leader>"} -- or specify a list manually
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
-- this is mostly relevant for key maps that start with a native binding
-- most people should not need to change this
n = { "o", "O" },
},
} }

View File

@@ -38,7 +38,9 @@ api.nvim_create_autocmd("TextYankPost", {
pattern = "*", pattern = "*",
group = yank_group, group = yank_group,
callback = function(ev) callback = function(ev)
if vim.v.event.operator == 'y' then
vim.fn.setpos('.', vim.g.current_cursor_pos) vim.fn.setpos('.', vim.g.current_cursor_pos)
end
end, end,
}) })
@@ -81,3 +83,23 @@ api.nvim_create_autocmd("VimResized", {
desc = "autoresize windows on resizing operation", desc = "autoresize windows on resizing operation",
command = "wincmd =", command = "wincmd =",
}) })
local function open_nvim_tree(data)
-- check if buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1
if not directory then
return
end
-- create a new, empty buffer
vim.cmd.enew()
-- wipe the directory buffer
vim.cmd.bw(data.buf)
-- open the tree
require("nvim-tree.api").tree.open()
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })

View File

@@ -1,6 +1,6 @@
local keymap = vim.keymap local keymap = vim.keymap
local api = vim.api local api = vim.api
local uv = vim.loop local uv = vim.uv
-- Save key strokes (now we do not need to press shift to enter command mode). -- Save key strokes (now we do not need to press shift to enter command mode).
keymap.set({ "n", "x" }, ";", ":") keymap.set({ "n", "x" }, ";", ":")
@@ -170,7 +170,7 @@ keymap.set("n", "<Down>", "<C-W>j")
keymap.set({ "x", "o" }, "iu", "<cmd>call text_obj#URL()<cr>", { desc = "URL text object" }) keymap.set({ "x", "o" }, "iu", "<cmd>call text_obj#URL()<cr>", { desc = "URL text object" })
-- Text objects for entire buffer -- Text objects for entire buffer
keymap.set({ "x", "o" }, "iB", "<cmd>call text_obj#Buffer()<cr>", { desc = "buffer text object" }) keymap.set({ "x", "o" }, "iB", ":<C-U>call text_obj#Buffer()<cr>", { desc = "buffer text object" })
-- Do not move my cursor when joining lines. -- Do not move my cursor when joining lines.
keymap.set("n", "J", function() keymap.set("n", "J", function()
@@ -179,17 +179,17 @@ keymap.set("n", "J", function()
delmarks z delmarks z
]]) ]])
end, { end, {
desc = "join line", desc = "join lines without moving cursor",
}) })
keymap.set("n", "gJ", function() keymap.set("n", "gJ", function()
-- we must use `normal!`, otherwise it will trigger recursive mapping -- we must use `normal!`, otherwise it will trigger recursive mapping
vim.cmd([[ vim.cmd([[
normal! zmgJ`z normal! mzgJ`z
delmarks z delmarks z
]]) ]])
end, { end, {
desc = "join visual lines", desc = "join lines without moving cursor",
}) })
-- Break inserted text into smaller undo units when we insert some punctuation chars. -- Break inserted text into smaller undo units when we insert some punctuation chars.
@@ -227,5 +227,7 @@ keymap.set("n", "<leader>cb", function()
end end
cnt = cnt + 1 cnt = cnt + 1
end))
end) end)
)
end,
{ desc = "show cursor" })

View File

@@ -2,7 +2,7 @@ local utils = require("utils")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.uv.fs_stat(lazypath) then
vim.fn.system { vim.fn.system {
"git", "git",
"clone", "clone",
@@ -19,13 +19,15 @@ local firenvim_not_active = function()
return not vim.g.started_by_firenvim return not vim.g.started_by_firenvim
end end
require("lazy").setup { local plugin_specs = {
{ "onsails/lspkind-nvim", lazy = true },
-- auto-completion engine -- auto-completion engine
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
-- event = 'InsertEnter',
event = "VeryLazy",
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"onsails/lspkind-nvim",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-omni", "hrsh7th/cmp-omni",
@@ -37,9 +39,9 @@ require("lazy").setup {
end, end,
}, },
-- nvim-lsp configuration (it relies on cmp-nvim-lsp, so it should be loaded after cmp-nvim-lsp).
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
event = { "BufRead", "BufNewFile" },
config = function() config = function()
require("config.lsp") require("config.lsp")
end, end,
@@ -53,7 +55,7 @@ require("lazy").setup {
end end
return false return false
end, end,
event = "BufEnter", event = "VeryLazy",
build = ":TSUpdate", build = ":TSUpdate",
config = function() config = function()
require("config.treesitter") require("config.treesitter")
@@ -66,7 +68,7 @@ require("lazy").setup {
-- Python-related text object -- Python-related text object
{ "jeetsukumaran/vim-pythonsense", ft = { "python" } }, { "jeetsukumaran/vim-pythonsense", ft = { "python" } },
{ "machakann/vim-swap", event = "VimEnter" }, { "machakann/vim-swap", event = "VeryLazy" },
-- IDE for Lisp -- IDE for Lisp
-- 'kovisoft/slimv' -- 'kovisoft/slimv'
@@ -86,12 +88,10 @@ require("lazy").setup {
-- Super fast buffer jump -- Super fast buffer jump
{ {
"phaazon/hop.nvim", "smoka7/hop.nvim",
event = "VimEnter", event = "VeryLazy",
config = function() config = function()
vim.defer_fn(function()
require("config.nvim_hop") require("config.nvim_hop")
end, 2000)
end, end,
}, },
@@ -121,27 +121,27 @@ require("lazy").setup {
"nvim-telescope/telescope-symbols.nvim", "nvim-telescope/telescope-symbols.nvim",
}, },
}, },
{
"lukas-reineke/headlines.nvim",
dependencies = "nvim-treesitter/nvim-treesitter",
config = true, -- or `opts = {}`
},
-- A list of colorscheme plugin you may want to try. Find what suits you. -- A list of colorscheme plugin you may want to try. Find what suits you.
{ "navarasu/onedark.nvim" }, { "navarasu/onedark.nvim", lazy = true },
{ "sainnhe/edge" }, { "sainnhe/edge", lazy = true },
{ "sainnhe/sonokai" }, { "sainnhe/sonokai", lazy = true },
{ "sainnhe/gruvbox-material" }, { "sainnhe/gruvbox-material", lazy = true },
{ "shaunsingh/nord.nvim" }, { "sainnhe/everforest", lazy = true },
{ "sainnhe/everforest" }, { "EdenEast/nightfox.nvim", lazy = true },
{ "EdenEast/nightfox.nvim" }, { "catppuccin/nvim", name = "catppuccin", lazy = true },
{ "rebelot/kanagawa.nvim" }, { "olimorris/onedarkpro.nvim", lazy = true },
{ "catppuccin/nvim", name = "catppuccin" }, { "marko-cerovac/material.nvim", lazy = true },
{ "rose-pine/neovim", name = "rose-pine" },
{ "olimorris/onedarkpro.nvim" },
{ "tanvirtin/monokai.nvim" },
{ "marko-cerovac/material.nvim" },
{ "nvim-tree/nvim-web-devicons", event = "VimEnter" }, { "nvim-tree/nvim-web-devicons", event = "VeryLazy" },
{ {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
event = "VimEnter", event = "VeryLazy",
cond = firenvim_not_active, cond = firenvim_not_active,
config = function() config = function()
require("config.statusline") require("config.statusline")
@@ -150,7 +150,7 @@ require("lazy").setup {
{ {
"akinsho/bufferline.nvim", "akinsho/bufferline.nvim",
event = "VimEnter", event = { "BufEnter" },
cond = firenvim_not_active, cond = firenvim_not_active,
config = function() config = function()
require("config.bufferline") require("config.bufferline")
@@ -160,7 +160,6 @@ require("lazy").setup {
-- fancy start screen -- fancy start screen
{ {
"nvimdev/dashboard-nvim", "nvimdev/dashboard-nvim",
event = "VimEnter",
cond = firenvim_not_active, cond = firenvim_not_active,
config = function() config = function()
require("config.dashboard-nvim") require("config.dashboard-nvim")
@@ -169,23 +168,22 @@ require("lazy").setup {
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
event = "VimEnter", event = "VeryLazy",
main = 'ibl',
config = function() config = function()
require("config.indent-blankline") require("config.indent-blankline")
end, end,
}, },
-- Highlight URLs inside vim -- Highlight URLs inside vim
{ "itchyny/vim-highlighturl", event = "VimEnter" }, { "itchyny/vim-highlighturl", event = "VeryLazy" },
-- notification plugin -- notification plugin
{ {
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
event = "BufEnter", event = "VeryLazy",
config = function() config = function()
vim.defer_fn(function()
require("config.nvim-notify") require("config.nvim-notify")
end, 2000)
end, end,
}, },
@@ -200,7 +198,7 @@ require("lazy").setup {
return false return false
end end
end, end,
event = "VimEnter", event = "VeryLazy",
}, },
-- Only install these plugins if ctags are installed on the system -- Only install these plugins if ctags are installed on the system
@@ -223,10 +221,14 @@ require("lazy").setup {
}, event = "InsertEnter" }, }, event = "InsertEnter" },
-- Automatic insertion and deletion of a pair of characters -- Automatic insertion and deletion of a pair of characters
{ "Raimondi/delimitMate", event = "InsertEnter" }, {
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true
},
-- Comment plugin -- Comment plugin
{ "tpope/vim-commentary", event = "VimEnter" }, { "tpope/vim-commentary", event = "VeryLazy" },
-- Multiple cursor plugin like Sublime Text? -- Multiple cursor plugin like Sublime Text?
-- 'mg979/vim-visual-multi' -- 'mg979/vim-visual-multi'
@@ -243,6 +245,7 @@ require("lazy").setup {
-- Manage your yank history -- Manage your yank history
{ {
"gbprod/yanky.nvim", "gbprod/yanky.nvim",
cmd = { "YankyRingHistory" },
config = function() config = function()
require("config.yanky") require("config.yanky")
end, end,
@@ -252,7 +255,7 @@ require("lazy").setup {
{ "tpope/vim-eunuch", cmd = { "Rename", "Delete" } }, { "tpope/vim-eunuch", cmd = { "Rename", "Delete" } },
-- Repeat vim motions -- Repeat vim motions
{ "tpope/vim-repeat", event = "VimEnter" }, { "tpope/vim-repeat", event = "VeryLazy" },
{ "nvim-zh/better-escape.vim", event = { "InsertEnter" } }, { "nvim-zh/better-escape.vim", event = { "InsertEnter" } },
@@ -292,7 +295,7 @@ require("lazy").setup {
-- Better git log display -- Better git log display
{ "rbong/vim-flog", cmd = { "Flog" } }, { "rbong/vim-flog", cmd = { "Flog" } },
{ "christoomey/vim-conflicted", cmd = { "Conflicted" } }, { "akinsho/git-conflict.nvim", version = "*", config = true },
{ {
"ruifm/gitlinker.nvim", "ruifm/gitlinker.nvim",
event = "User InGitRepo", event = "User InGitRepo",
@@ -311,6 +314,11 @@ require("lazy").setup {
-- Better git commit experience -- Better git commit experience
{ "rhysd/committia.vim", lazy = true }, { "rhysd/committia.vim", lazy = true },
{
"sindrets/diffview.nvim"
},
{ {
"kevinhwang91/nvim-bqf", "kevinhwang91/nvim-bqf",
ft = "qf", ft = "qf",
@@ -360,17 +368,17 @@ require("lazy").setup {
ft = { "markdown" }, ft = { "markdown" },
}, },
{ "chrisbra/unicode.vim", event = "VimEnter" }, { "chrisbra/unicode.vim", event = "VeryLazy" },
-- Additional powerful text object for vim, this plugin should be studied -- Additional powerful text object for vim, this plugin should be studied
-- carefully to use its full power -- carefully to use its full power
{ "wellle/targets.vim", event = "VimEnter" }, { "wellle/targets.vim", event = "VeryLazy" },
-- Plugin to manipulate character pairs quickly -- Plugin to manipulate character pairs quickly
{ "machakann/vim-sandwich", event = "VimEnter" }, { "machakann/vim-sandwich", event = "VeryLazy" },
-- Add indent object for vim (useful for languages like Python) -- Add indent object for vim (useful for languages like Python)
{ "michaeljsmith/vim-indent-object", event = "VimEnter" }, { "michaeljsmith/vim-indent-object", event = "VeryLazy" },
-- Only use these plugin on Windows and Mac and when LaTeX is installed -- Only use these plugin on Windows and Mac and when LaTeX is installed
{ {
@@ -399,7 +407,7 @@ require("lazy").setup {
}, },
-- Modern matchit implementation -- Modern matchit implementation
{ "andymass/vim-matchup", event = "VimEnter" }, { "andymass/vim-matchup", event = "BufRead" },
{ "tpope/vim-scriptease", cmd = { "Scriptnames", "Message", "Verbose" } }, { "tpope/vim-scriptease", cmd = { "Scriptnames", "Message", "Verbose" } },
-- Asynchronous command execution -- Asynchronous command execution
@@ -449,37 +457,50 @@ require("lazy").setup {
}, },
-- The missing auto-completion for cmdline! -- The missing auto-completion for cmdline!
{ "gelguy/wilder.nvim" }, {
"gelguy/wilder.nvim",
build = ":UpdateRemotePlugins",
},
-- showing keybindings -- showing keybindings
{ {
"folke/which-key.nvim", "folke/which-key.nvim",
event = "VimEnter", event = "VeryLazy",
config = function() config = function()
vim.defer_fn(function()
require("config.which-key") require("config.which-key")
end, 2000)
end, end,
}, },
-- show and trim trailing whitespaces -- show and trim trailing whitespaces
{ "jdhao/whitespace.nvim", event = "VimEnter" }, { "jdhao/whitespace.nvim", event = "VeryLazy" },
-- file explorer -- file explorer
{ {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
keys = { "<space>s" },
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() config = function()
require("config.nvim-tree") require("config.nvim-tree")
end, end,
}, },
{ "ii14/emmylua-nvim", ft = "lua" },
{ {
"j-hui/fidget.nvim", "j-hui/fidget.nvim",
event = "VeryLazy",
tag = "legacy", tag = "legacy",
config = function() config = function()
require("config.fidget-nvim") require("config.fidget-nvim")
end, end,
}, },
} }
-- configuration for lazy itself.
local lazy_opts = {
ui = {
border = "rounded",
title = "Plugin Manager",
title_pos = "center",
},
}
require("lazy").setup(plugin_specs, lazy_opts)

View File

@@ -458,3 +458,12 @@ pyright
stubgen stubgen
pylance pylance
variadic variadic
Vimium
Databricks
Jira
databricks
FastAPI
pylintrc
PYTHONPATH
Uvicorn
qpdf

View File

@@ -1,7 +1,7 @@
scriptencoding utf-8 scriptencoding utf-8
" change fillchars for folding, vertical split, end of buffer, and message separator " change fillchars for folding, vertical split, end of buffer, and message separator
set fillchars=fold:\ ,vert:\│,eob:\ ,msgsep:‾ set fillchars=fold:\ ,vert:\│,eob:\ ,msgsep:‾,diff:
" Split window below/right when creating horizontal/vertical windows " Split window below/right when creating horizontal/vertical windows
set splitbelow splitright set splitbelow splitright

View File

@@ -1,7 +1,7 @@
scriptencoding utf-8 scriptencoding utf-8
" Plugin specification and lua stuff " Plugin specification and lua stuff
lua require('plugins') lua require('plugin_specs')
" Use short names for common plugin manager commands to simplify typing. " Use short names for common plugin manager commands to simplify typing.
" To use these shortcuts: first activate command line with `:`, then input the " To use these shortcuts: first activate command line with `:`, then input the