mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb8c9208e1 | ||
|
|
ce1e13e2c9 | ||
|
|
2af616bb0d | ||
|
|
3694d3c237 | ||
|
|
69d8543495 | ||
|
|
be3d134c37 | ||
|
|
601396f700 | ||
|
|
e462ebcbcc | ||
|
|
2f8482639d | ||
|
|
050eacaee2 | ||
|
|
01bc4b40d3 | ||
|
|
c06d46e84d | ||
|
|
7cf70f31af | ||
|
|
8416508686 | ||
|
|
df9491b05b | ||
|
|
17d2e3ab3e | ||
|
|
2c9948300d | ||
|
|
dfaa3d97a5 | ||
|
|
8d74fcb75c | ||
|
|
b1f0ef63ef | ||
|
|
54ca6d4191 | ||
|
|
97af59e670 | ||
|
|
4d8ef868ad | ||
|
|
3137850db6 | ||
|
|
eccdc62f38 | ||
|
|
ad483a7dc0 |
@@ -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.2-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.2">
|
<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.2?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).
|
||||||
|
|||||||
@@ -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 = "(:),[:],{:}"
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
9
init.lua
9
init.lua
@@ -14,11 +14,13 @@ vim.loader.enable()
|
|||||||
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.2"
|
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("Expect nvim %s, but got %s instead. Use at your own risk!", expected_ver, _ver)
|
local msg = string.format("Expect nvim %s, but got %s instead. Use at your own risk!", expected_ver, _ver)
|
||||||
vim.api.nvim_err_writeln(msg)
|
vim.api.nvim_err_writeln(msg)
|
||||||
@@ -33,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
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
{
|
|
||||||
"LeaderF": { "branch": "master", "commit": "9c4451d2c1a6ea1f32e39fe52d58f6f5655b231d" },
|
|
||||||
"asyncrun.vim": { "branch": "master", "commit": "42385d54b8546c163b946fd50eed2103ef7993c9" },
|
|
||||||
"better-escape.vim": { "branch": "master", "commit": "6b16a45a839727977277f6ab11bded63e9ed86bb" },
|
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "9961d87bb3ec008213c46ba14b3f384a5f520eb5" },
|
|
||||||
"catppuccin": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" },
|
|
||||||
"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": "bbe0234168501b8ba46f24b4fb3cb7c5b88c0784" },
|
|
||||||
"delimitMate": { "branch": "master", "commit": "537a1da0fa5eeb88640425c37e545af933c56e1b" },
|
|
||||||
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
|
|
||||||
"edge": { "branch": "master", "commit": "a4fd4f458331d42677d992f428235c491b2016aa" },
|
|
||||||
"emmylua-nvim": { "branch": "master", "commit": "38720eb5f1dac8e87254fd944dbe0959b2e67d94" },
|
|
||||||
"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": "907ae8636016aab2f283576fc60d46ca3427e579" },
|
|
||||||
"gruvbox-material": { "branch": "master", "commit": "b5f8c6a6c1cda630c53b061b765068a0898d47a3" },
|
|
||||||
"hop.nvim": { "branch": "master", "commit": "1a1eceafe54b5081eae4cb91c723abd1d450f34b" },
|
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
|
|
||||||
"kanagawa.nvim": { "branch": "master", "commit": "a4e99f089110c6d00bc33f5497709200e914e763" },
|
|
||||||
"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": "e886e39e592e89f316536a6f070365a9d88901c9" },
|
|
||||||
"nord.nvim": { "branch": "master", "commit": "15fbfc38a83980b93e169b32a1bf64757f1e2bf4" },
|
|
||||||
"nvim-bqf": { "branch": "main", "commit": "a906a9dfc1bd7b3ac51ac954e32e157ffad9a7cd" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
|
||||||
"nvim-hlslens": { "branch": "main", "commit": "f0281591a59e95400babf61a96e59ba20e5c9533" },
|
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "cc388d3f6b9c7c943ae2b2dcd46ad470fd257f91" },
|
|
||||||
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" },
|
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "94c7c810af205c0f00c8f105dcf490c8eb17658a" },
|
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "bf8b089eecef9e9e8c1765f81613a2fd5e49175c" },
|
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" },
|
|
||||||
"onedark.nvim": { "branch": "master", "commit": "dac8c39812dae025255c9069a260e1f69d967927" },
|
|
||||||
"onedarkpro.nvim": { "branch": "main", "commit": "fa861b992471d55f653751f1fea8769ca536a554" },
|
|
||||||
"open-browser.vim": { "branch": "master", "commit": "7d4c1d8198e889d513a030b5a83faa07606bac27" },
|
|
||||||
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
|
|
||||||
"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": "59812c26d826e8c717e29406267ea1260f71e103" },
|
|
||||||
"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": "58c1d39ec42f92d23a1204b1869e5d1dece8b86c" },
|
|
||||||
"vim-fugitive": { "branch": "master", "commit": "6fcb0ad03982de646e3fecb6915e585651b9a9fb" },
|
|
||||||
"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": "6dbe108230c7dbbf00555b7d4d9f6a891837ef07" },
|
|
||||||
"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": "ccc2fa1529d372f7ac16d5eb07a385a72b50e05d" },
|
|
||||||
"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": "2b8a5f16a5768b3ae1780c266b73022dbb658af1" },
|
|
||||||
"vista.vim": { "branch": "master", "commit": "40daf5e97be70a90465182fbbdfba92442bfd8e1" },
|
|
||||||
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
|
|
||||||
"whitespace.nvim": { "branch": "master", "commit": "f0fc9e9c4ce3f7d2166e9e5a069b64b9ca4a3f15" },
|
|
||||||
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" },
|
|
||||||
"yanky.nvim": { "branch": "main", "commit": "4c85d8d6808d9859e72f8bd6c25302199e6a5eac" },
|
|
||||||
"zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" }
|
|
||||||
}
|
|
||||||
@@ -6,123 +6,63 @@ 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",
|
vim.cmd([[colorscheme onedark]])
|
||||||
sonokai = "sonokai",
|
end,
|
||||||
gruvbox_material = "gruvbox-material",
|
edge = function()
|
||||||
nord = "nord.nvim",
|
vim.g.edge_enable_italic = 1
|
||||||
everforest = "everforest",
|
vim.g.edge_better_performance = 1
|
||||||
nightfox = "nightfox.nvim",
|
|
||||||
kanagawa = "kanagawa.nvim",
|
vim.cmd([[colorscheme edge]])
|
||||||
catppuccin = "catppuccin",
|
end,
|
||||||
rose_pine = "rose-pine",
|
sonokai = function()
|
||||||
onedarkpro = "onedarkpro.nvim",
|
vim.g.sonokai_enable_italic = 1
|
||||||
monokai = "monokai.nvim",
|
vim.g.sonokai_better_performance = 1
|
||||||
material = "material.nvim",
|
|
||||||
|
vim.cmd([[colorscheme sonokai]])
|
||||||
|
end,
|
||||||
|
gruvbox_material = function()
|
||||||
|
-- foreground option can be material, mix, or original
|
||||||
|
vim.g.gruvbox_material_foreground = "material"
|
||||||
|
--background option can be hard, medium, soft
|
||||||
|
vim.g.gruvbox_material_background = "soft"
|
||||||
|
vim.g.gruvbox_material_enable_italic = 1
|
||||||
|
vim.g.gruvbox_material_better_performance = 1
|
||||||
|
|
||||||
|
vim.cmd([[colorscheme gruvbox-material]])
|
||||||
|
end,
|
||||||
|
everforest = function()
|
||||||
|
vim.g.everforest_enable_italic = 1
|
||||||
|
vim.g.everforest_better_performance = 1
|
||||||
|
|
||||||
|
vim.cmd([[colorscheme everforest]])
|
||||||
|
end,
|
||||||
|
nightfox = function()
|
||||||
|
vim.cmd([[colorscheme nordfox]])
|
||||||
|
end,
|
||||||
|
catppuccin = function()
|
||||||
|
-- available option: latte, frappe, macchiato, mocha
|
||||||
|
vim.g.catppuccin_flavour = "frappe"
|
||||||
|
require("catppuccin").setup()
|
||||||
|
|
||||||
|
vim.cmd([[colorscheme catppuccin]])
|
||||||
|
end,
|
||||||
|
onedarkpro = function()
|
||||||
|
-- set colorscheme after options
|
||||||
|
vim.cmd('colorscheme onedark_vivid')
|
||||||
|
end,
|
||||||
|
material = function()
|
||||||
|
vim.g.material_style = "oceanic"
|
||||||
|
vim.cmd('colorscheme material')
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
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]])
|
|
||||||
end
|
|
||||||
|
|
||||||
M.edge = function()
|
|
||||||
vim.g.edge_enable_italic = 1
|
|
||||||
vim.g.edge_better_performance = 1
|
|
||||||
|
|
||||||
vim.cmd([[colorscheme edge]])
|
|
||||||
end
|
|
||||||
|
|
||||||
M.sonokai = function()
|
|
||||||
vim.g.sonokai_enable_italic = 1
|
|
||||||
vim.g.sonokai_better_performance = 1
|
|
||||||
|
|
||||||
vim.cmd([[colorscheme sonokai]])
|
|
||||||
end
|
|
||||||
|
|
||||||
M.gruvbox_material = function()
|
|
||||||
-- foreground option can be material, mix, or original
|
|
||||||
vim.g.gruvbox_material_foreground = "material"
|
|
||||||
--background option can be hard, medium, soft
|
|
||||||
vim.g.gruvbox_material_background = "soft"
|
|
||||||
vim.g.gruvbox_material_enable_italic = 1
|
|
||||||
vim.g.gruvbox_material_better_performance = 1
|
|
||||||
|
|
||||||
vim.cmd([[colorscheme gruvbox-material]])
|
|
||||||
end
|
|
||||||
|
|
||||||
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_better_performance = 1
|
|
||||||
|
|
||||||
vim.cmd([[colorscheme everforest]])
|
|
||||||
end
|
|
||||||
|
|
||||||
M.nightfox = function()
|
|
||||||
vim.cmd([[colorscheme nordfox]])
|
|
||||||
end
|
|
||||||
|
|
||||||
M.kanagawa = function()
|
|
||||||
vim.cmd([[colorscheme kanagawa]])
|
|
||||||
end
|
|
||||||
|
|
||||||
M.catppuccin = function()
|
|
||||||
-- available option: latte, frappe, macchiato, mocha
|
|
||||||
vim.g.catppuccin_flavour = "frappe"
|
|
||||||
|
|
||||||
require("catppuccin").setup()
|
|
||||||
|
|
||||||
vim.cmd([[colorscheme catppuccin]])
|
|
||||||
end
|
|
||||||
|
|
||||||
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
|
|
||||||
vim.cmd('colorscheme onedark_vivid')
|
|
||||||
end
|
|
||||||
|
|
||||||
M.monokai = function()
|
|
||||||
vim.cmd('colorscheme monokai_pro')
|
|
||||||
end
|
|
||||||
|
|
||||||
M.material = function ()
|
|
||||||
vim.g.material_style = "oceanic"
|
|
||||||
vim.cmd('colorscheme material')
|
|
||||||
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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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 = {
|
||||||
char = "▏",
|
-- -- U+2502 may also be a good choice, it will be on the middle of cursor.
|
||||||
show_end_of_line = false,
|
-- -- U+250A is also a good choice
|
||||||
disable_with_nolist = true,
|
char = "▏",
|
||||||
buftype_exclude = { "terminal" },
|
},
|
||||||
filetype_exclude = exclude_ft,
|
scope = {
|
||||||
|
show_start = false,
|
||||||
|
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,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
|
})
|
||||||
|
|||||||
@@ -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 = {
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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" },
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,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 })
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -217,7 +217,7 @@ keymap.set("n", "<leader>cb", function()
|
|||||||
local timer = uv.new_timer()
|
local timer = uv.new_timer()
|
||||||
|
|
||||||
timer:start(0, 100, vim.schedule_wrap(function()
|
timer:start(0, 100, vim.schedule_wrap(function()
|
||||||
vim.cmd[[
|
vim.cmd [[
|
||||||
set cursorcolumn!
|
set cursorcolumn!
|
||||||
set cursorline!
|
set cursorline!
|
||||||
]]
|
]]
|
||||||
@@ -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" })
|
||||||
|
|||||||
@@ -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",
|
||||||
@@ -88,12 +88,10 @@ local plugin_specs = {
|
|||||||
|
|
||||||
-- Super fast buffer jump
|
-- Super fast buffer jump
|
||||||
{
|
{
|
||||||
"phaazon/hop.nvim",
|
"smoka7/hop.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
vim.defer_fn(function()
|
require("config.nvim_hop")
|
||||||
require("config.nvim_hop")
|
|
||||||
end, 2000)
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -123,20 +121,20 @@ local plugin_specs = {
|
|||||||
"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", lazy = true },
|
{ "navarasu/onedark.nvim", lazy = true },
|
||||||
{ "sainnhe/edge", lazy = true },
|
{ "sainnhe/edge", lazy = true },
|
||||||
{ "sainnhe/sonokai", lazy = true },
|
{ "sainnhe/sonokai", lazy = true },
|
||||||
{ "sainnhe/gruvbox-material", lazy = true },
|
{ "sainnhe/gruvbox-material", lazy = true },
|
||||||
{ "shaunsingh/nord.nvim", lazy = true },
|
|
||||||
{ "sainnhe/everforest", lazy = true },
|
{ "sainnhe/everforest", lazy = true },
|
||||||
{ "EdenEast/nightfox.nvim", lazy = true },
|
{ "EdenEast/nightfox.nvim", lazy = true },
|
||||||
{ "rebelot/kanagawa.nvim", lazy = true },
|
|
||||||
{ "catppuccin/nvim", name = "catppuccin", lazy = true },
|
{ "catppuccin/nvim", name = "catppuccin", lazy = true },
|
||||||
{ "rose-pine/neovim", name = "rose-pine", lazy = true },
|
|
||||||
{ "olimorris/onedarkpro.nvim", lazy = true },
|
{ "olimorris/onedarkpro.nvim", lazy = true },
|
||||||
{ "tanvirtin/monokai.nvim", lazy = true },
|
|
||||||
{ "marko-cerovac/material.nvim", lazy = true },
|
{ "marko-cerovac/material.nvim", lazy = true },
|
||||||
|
|
||||||
{ "nvim-tree/nvim-web-devicons", event = "VeryLazy" },
|
{ "nvim-tree/nvim-web-devicons", event = "VeryLazy" },
|
||||||
@@ -171,6 +169,7 @@ local plugin_specs = {
|
|||||||
{
|
{
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
main = 'ibl',
|
||||||
config = function()
|
config = function()
|
||||||
require("config.indent-blankline")
|
require("config.indent-blankline")
|
||||||
end,
|
end,
|
||||||
@@ -184,9 +183,7 @@ local plugin_specs = {
|
|||||||
"rcarriga/nvim-notify",
|
"rcarriga/nvim-notify",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
vim.defer_fn(function()
|
require("config.nvim-notify")
|
||||||
require("config.nvim-notify")
|
|
||||||
end, 2000)
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -224,7 +221,11 @@ local plugin_specs = {
|
|||||||
}, 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 = "VeryLazy" },
|
{ "tpope/vim-commentary", event = "VeryLazy" },
|
||||||
@@ -294,7 +295,7 @@ local plugin_specs = {
|
|||||||
|
|
||||||
-- 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",
|
||||||
@@ -313,6 +314,11 @@ local plugin_specs = {
|
|||||||
|
|
||||||
-- 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",
|
||||||
@@ -461,9 +467,7 @@ local plugin_specs = {
|
|||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
vim.defer_fn(function()
|
require("config.which-key")
|
||||||
require("config.which-key")
|
|
||||||
end, 2000)
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -480,7 +484,6 @@ local plugin_specs = {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "ii14/emmylua-nvim", ft = "lua" },
|
|
||||||
{
|
{
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user