mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a4d71db88 | ||
|
|
dc597004df | ||
|
|
644993a89e | ||
|
|
164d6129f8 | ||
|
|
cde21f6f67 | ||
|
|
8746c7eb11 | ||
|
|
7c44997289 | ||
|
|
bfdb3f5a26 | ||
|
|
76ced0e265 | ||
|
|
e84d18a204 | ||
|
|
6429e8364c | ||
|
|
f2c6900a8d | ||
|
|
116aaa0675 | ||
|
|
12f3ca9d1f | ||
|
|
7e7944a30c | ||
|
|
53c17aea96 | ||
|
|
43c1615822 | ||
|
|
509a8bce8c | ||
|
|
8b10be60d4 | ||
|
|
074d2bbdfd | ||
|
|
7f9af87185 | ||
|
|
bb0b0c5e25 | ||
|
|
7bb12e4b70 | ||
|
|
41da56b823 | ||
|
|
82f2332281 | ||
|
|
075326ee2e | ||
|
|
baa8f26bc2 | ||
|
|
e9760ae9b8 | ||
|
|
0d50eb723f | ||
|
|
b893bdc099 | ||
|
|
2073f72e67 | ||
|
|
364be4b5dc | ||
|
|
d30d402128 | ||
|
|
fc144e0895 | ||
|
|
18abfa7754 | ||
|
|
6c1dbdf8fc | ||
|
|
202a9a088d | ||
|
|
d939cc75c6 | ||
|
|
26921309ec | ||
|
|
a6f716558b | ||
|
|
3539207913 | ||
|
|
d8b92965e8 | ||
|
|
ebf7170916 | ||
|
|
696466469b | ||
|
|
7a5be43600 | ||
|
|
3b39067097 | ||
|
|
e6b3be0777 | ||
|
|
acb423984a |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2018-2022 jdhao
|
Copyright (c) 2018-2023 jdhao
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -9,24 +9,27 @@
|
|||||||
<a>
|
<a>
|
||||||
<img alt="Windows" src="https://img.shields.io/badge/Windows-%23.svg?style=flat-square&logo=windows&color=0078D6&logoColor=white" />
|
<img alt="Windows" src="https://img.shields.io/badge/Windows-%23.svg?style=flat-square&logo=windows&color=0078D6&logoColor=white" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/jdhao/nvim-config/commits">
|
|
||||||
<img src="https://badgen.net/github/commits/jdhao/nvim-config" alt="Commit number" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/jdhao/nvim-config/network">
|
|
||||||
<img alt="Forks" src="https://badgen.net/github/forks/jdhao/nvim-config">
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/jdhao/nvim-config/stargazers">
|
|
||||||
<img alt="Stars" src="https://badgen.net/github/stars/jdhao/nvim-config">
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/jdhao/nvim-config/releases/latest">
|
<a href="https://github.com/jdhao/nvim-config/releases/latest">
|
||||||
<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.7.2-blueviolet.svg?style=flat-square&logo=Neovim&logoColor=green" alt="Neovim minimum version"/>
|
<img src="https://img.shields.io/badge/Neovim-0.8.1-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"/>
|
||||||
</a>
|
</a>
|
||||||
|
<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" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/jdhao/nvim-config/releases/tag/v0.8.1">
|
||||||
|
<img src="https://img.shields.io/github/commits-since/jdhao/nvim-config/v0.8.1?style=flat-square" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/jdhao/nvim-config/graphs/contributors">
|
||||||
|
<img src="https://img.shields.io/github/contributors/jdhao/nvim-config?style=flat-square" />
|
||||||
|
</a>
|
||||||
|
<a>
|
||||||
|
<img src="https://img.shields.io/github/repo-size/jdhao/nvim-config?style=flat-square" />
|
||||||
|
</a>
|
||||||
<a href="https://github.com/jdhao/nvim-config/blob/master/LICENSE">
|
<a href="https://github.com/jdhao/nvim-config/blob/master/LICENSE">
|
||||||
<img src="https://img.shields.io/github/license/jdhao/nvim-config?style=flat-square&logo=GNU&label=License" alt="License"/>
|
<img src="https://img.shields.io/github/license/jdhao/nvim-config?style=flat-square&logo=GNU&label=License" alt="License"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -66,7 +69,7 @@ and how to set up on different platforms (Linux, macOS, and Windows).
|
|||||||
+ 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).
|
||||||
+ Beautiful statusline via [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim).
|
+ Beautiful statusline via [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim).
|
||||||
+ File tree explorer via [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua).
|
+ File tree explorer via [nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua).
|
||||||
+ Better quickfix list with [nvim-bqf](https://github.com/kevinhwang91/nvim-bqf).
|
+ Better quickfix list with [nvim-bqf](https://github.com/kevinhwang91/nvim-bqf).
|
||||||
+ Show search index and count with [nvim-hlslens](https://github.com/kevinhwang91/nvim-hlslens).
|
+ Show search index and count with [nvim-hlslens](https://github.com/kevinhwang91/nvim-hlslens).
|
||||||
+ Command line auto-completion via [wilder.nvim](https://github.com/gelguy/wilder.nvim).
|
+ Command line auto-completion via [wilder.nvim](https://github.com/gelguy/wilder.nvim).
|
||||||
@@ -76,9 +79,8 @@ and how to set up on different platforms (Linux, macOS, and Windows).
|
|||||||
+ Code editing using true nvim inside browser via [firenvim](https://github.com/glacambre/firenvim).
|
+ Code editing using true nvim inside browser via [firenvim](https://github.com/glacambre/firenvim).
|
||||||
+ Beautiful colorscheme via [sainnhe/gruvbox-material](https://github.com/sainnhe/gruvbox-material) and other colorschemes.
|
+ Beautiful colorscheme via [sainnhe/gruvbox-material](https://github.com/sainnhe/gruvbox-material) and other colorschemes.
|
||||||
+ Markdown writing and previewing via [vim-markdown](https://github.com/preservim/vim-markdown) and [markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim).
|
+ Markdown writing and previewing via [vim-markdown](https://github.com/preservim/vim-markdown) and [markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim).
|
||||||
+ LaTeX editing and previewing via [vimtex](https://github.com/lervag/vimtex) <sup id="a1">[1](#f1)</sup>.
|
+ LaTeX editing and previewing via [vimtex](https://github.com/lervag/vimtex)
|
||||||
+ Animated GUI style notification via [nvim-notify](https://github.com/rcarriga/nvim-notify).
|
+ Animated GUI style notification via [nvim-notify](https://github.com/rcarriga/nvim-notify).
|
||||||
+ Smooth scroll experience via [neoscroll](https://github.com/karb94/neoscroll.nvim).
|
|
||||||
+ Tags navigation via [vista](https://github.com/liuchengxu/vista.vim).
|
+ Tags navigation via [vista](https://github.com/liuchengxu/vista.vim).
|
||||||
+ Code formatting via [Neoformat](https://github.com/sbdchd/neoformat).
|
+ Code formatting via [Neoformat](https://github.com/sbdchd/neoformat).
|
||||||
+ Undo management via [vim-mundo](https://github.com/simnalamburt/vim-mundo)
|
+ Undo management via [vim-mundo](https://github.com/simnalamburt/vim-mundo)
|
||||||
@@ -214,5 +216,3 @@ You may also be interested in my posts on configuring Nvim:
|
|||||||
+ [Config nvim on Linux for Python development](https://jdhao.github.io/2018/12/24/centos_nvim_install_use_guide_en/)
|
+ [Config nvim on Linux for Python development](https://jdhao.github.io/2018/12/24/centos_nvim_install_use_guide_en/)
|
||||||
+ [Nvim config on Windows 10](https://jdhao.github.io/2018/11/15/neovim_configuration_windows/)
|
+ [Nvim config on Windows 10](https://jdhao.github.io/2018/11/15/neovim_configuration_windows/)
|
||||||
+ [Nvim-qt config on Windows 10](https://jdhao.github.io/2019/01/17/nvim_qt_settings_on_windows/)
|
+ [Nvim-qt config on Windows 10](https://jdhao.github.io/2019/01/17/nvim_qt_settings_on_windows/)
|
||||||
|
|
||||||
<b id="f1">1:</b> Not enabled for Linux, you need to tweak [`lua/plugins.lua`](lua/plugins.lua) and change the condition for installing vimtex.[↩](#a1)
|
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
set commentstring=//\ %s
|
set commentstring=//\ %s
|
||||||
|
|
||||||
set tabstop=2 " number of visual spaces per TAB
|
|
||||||
set softtabstop=2 " number of spaces in tab when editing
|
|
||||||
set shiftwidth=2 " number of spaces to use for autoindent
|
|
||||||
set expandtab " expand tab to spaces so that tabs are spaces
|
|
||||||
|
|
||||||
" Disable inserting comment leader after hitting o or O or <Enter>
|
" Disable inserting comment leader after hitting o or O or <Enter>
|
||||||
set formatoptions-=o
|
set formatoptions-=o
|
||||||
set formatoptions-=r
|
set formatoptions-=r
|
||||||
|
|||||||
1
after/ftplugin/gitconfig.vim
Normal file
1
after/ftplugin/gitconfig.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
set commentstring=#\ %s
|
||||||
@@ -1,8 +1,3 @@
|
|||||||
" Disable inserting comment leader after hitting o or O or <Enter>
|
" Disable inserting comment leader after hitting o or O or <Enter>
|
||||||
set formatoptions-=o
|
set formatoptions-=o
|
||||||
set formatoptions-=r
|
set formatoptions-=r
|
||||||
|
|
||||||
set tabstop=2 " number of visual spaces per TAB
|
|
||||||
set softtabstop=2 " number of spaces in tab when editing
|
|
||||||
set shiftwidth=2 " number of spaces to use for autoindent
|
|
||||||
set expandtab " expand tab to spaces so that tabs are spaces
|
|
||||||
|
|||||||
@@ -2,12 +2,7 @@
|
|||||||
set formatoptions-=o
|
set formatoptions-=o
|
||||||
set formatoptions-=r
|
set formatoptions-=r
|
||||||
|
|
||||||
set tabstop=2 " number of visual spaces per TAB
|
nnoremap <buffer><silent> <F9> :luafile %<CR>
|
||||||
set softtabstop=2 " number of spaces in tab when editing
|
|
||||||
set shiftwidth=2 " number of spaces to use for autoindent
|
|
||||||
set expandtab " expand tab to spaces so that tabs are spaces
|
|
||||||
|
|
||||||
nnoremap <silent> <F9> :luafile %<CR>
|
|
||||||
|
|
||||||
" For delimitMate
|
" For delimitMate
|
||||||
let b:delimitMate_matchpairs = "(:),[:],{:}"
|
let b:delimitMate_matchpairs = "(:),[:],{:}"
|
||||||
|
|||||||
@@ -8,5 +8,10 @@ set sidescroll=5
|
|||||||
set sidescrolloff=2
|
set sidescrolloff=2
|
||||||
set colorcolumn=100
|
set colorcolumn=100
|
||||||
|
|
||||||
|
set tabstop=4 " number of visual spaces per TAB
|
||||||
|
set softtabstop=4 " number of spaces in tab when editing
|
||||||
|
set shiftwidth=4 " number of spaces to use for autoindent
|
||||||
|
set expandtab " expand tab to spaces so that tabs are spaces
|
||||||
|
|
||||||
" For delimitMate
|
" For delimitMate
|
||||||
let b:delimitMate_matchpairs = "(:),[:],{:}"
|
let b:delimitMate_matchpairs = "(:),[:],{:}"
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
set tabstop=2 " number of visual spaces per TAB
|
|
||||||
set softtabstop=2 " number of spaces in tab when editing
|
|
||||||
set shiftwidth=2 " number of spaces to use for autoindent
|
|
||||||
set expandtab " expand tab to spaces so that tabs are spaces
|
|
||||||
|
|||||||
@@ -12,9 +12,4 @@ set foldmethod=expr foldexpr=utils#VimFolds(v:lnum) foldtext=utils#MyFoldText()
|
|||||||
" see `:h K` and https://stackoverflow.com/q/15867323/6064933
|
" see `:h K` and https://stackoverflow.com/q/15867323/6064933
|
||||||
set keywordprg=:help
|
set keywordprg=:help
|
||||||
|
|
||||||
set tabstop=2 " number of visual spaces per TAB
|
nnoremap <buffer><silent> <F9> :source %<CR>
|
||||||
set softtabstop=2 " number of spaces in tab when editing
|
|
||||||
set shiftwidth=2 " number of spaces to use for autoindent
|
|
||||||
set expandtab " expand tab to spaces so that tabs are spaces
|
|
||||||
|
|
||||||
nnoremap <silent> <F9> :source %<CR>
|
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
set tabstop=2 " number of visual spaces per TAB
|
|
||||||
set softtabstop=2 " number of spaces in tab when editing
|
|
||||||
set shiftwidth=2 " number of spaces to use for autoindent
|
|
||||||
set expandtab " expand tab to spaces so that tabs are spaces
|
|
||||||
|
|
||||||
" Turn off syntax highlighting for large YAML files.
|
" Turn off syntax highlighting for large YAML files.
|
||||||
if line('$') > 500
|
if line('$') > 500
|
||||||
setlocal syntax=OFF
|
setlocal syntax=OFF
|
||||||
|
|||||||
@@ -7,17 +7,19 @@ 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.colorscheme2dir = {
|
||||||
gruvbox8 = "vim-gruvbox8",
|
|
||||||
onedark = "onedark.nvim",
|
onedark = "onedark.nvim",
|
||||||
edge = "edge",
|
edge = "edge",
|
||||||
sonokai = "sonokai",
|
sonokai = "sonokai",
|
||||||
gruvbox_material = "gruvbox-material",
|
gruvbox_material = "gruvbox-material",
|
||||||
nord = "nord.nvim",
|
nord = "nord.nvim",
|
||||||
doom_one = "doom-one.nvim",
|
|
||||||
everforest = "everforest",
|
everforest = "everforest",
|
||||||
nightfox = "nightfox.nvim",
|
nightfox = "nightfox.nvim",
|
||||||
kanagawa = "kanagawa.nvim",
|
kanagawa = "kanagawa.nvim",
|
||||||
catppuccin = "catppuccin",
|
catppuccin = "catppuccin",
|
||||||
|
rose_pine = "rose-pine",
|
||||||
|
onedarkpro = "onedarkpro.nvim",
|
||||||
|
monokai = "monokai.nvim",
|
||||||
|
material = "material.nvim",
|
||||||
}
|
}
|
||||||
|
|
||||||
M.gruvbox8 = function()
|
M.gruvbox8 = function()
|
||||||
@@ -50,6 +52,10 @@ M.sonokai = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.gruvbox_material = function()
|
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_enable_italic = 1
|
||||||
vim.g.gruvbox_material_better_performance = 1
|
vim.g.gruvbox_material_better_performance = 1
|
||||||
|
|
||||||
@@ -88,6 +94,30 @@ M.catppuccin = function()
|
|||||||
vim.cmd([[colorscheme catppuccin]])
|
vim.cmd([[colorscheme catppuccin]])
|
||||||
end
|
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.colorscheme2dir))
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ local utils = require('utils')
|
|||||||
|
|
||||||
-- Inspect something
|
-- Inspect something
|
||||||
function _G.inspect(item)
|
function _G.inspect(item)
|
||||||
vim.pretty_print(item)
|
vim.print(item)
|
||||||
end
|
end
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
@@ -43,9 +43,7 @@ vim.g.mapleader = ','
|
|||||||
vim.g.vimsyn_embed = 'l'
|
vim.g.vimsyn_embed = 'l'
|
||||||
|
|
||||||
-- Use English as main language
|
-- Use English as main language
|
||||||
if not vim.g.is_mac then
|
vim.cmd [[language en_US.UTF-8]]
|
||||||
vim.cmd [[language en_US.utf-8]]
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Disable loading certain plugins
|
-- Disable loading certain plugins
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
local keymap = vim.keymap
|
local keymap = vim.keymap
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
|
local uv = vim.loop
|
||||||
|
|
||||||
-- 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" }, ";", ":")
|
||||||
@@ -85,16 +86,15 @@ keymap.set("n", "<leader>ev", "<cmd>tabnew $MYVIMRC <bar> tcd %:h<cr>", {
|
|||||||
desc = "open init.lua",
|
desc = "open init.lua",
|
||||||
})
|
})
|
||||||
|
|
||||||
keymap.set("n", "<leader>sv", "", {
|
keymap.set("n", "<leader>sv", function()
|
||||||
silent = true,
|
|
||||||
desc = "reload init.lua",
|
|
||||||
callback = function()
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
update $MYVIMRC
|
update $MYVIMRC
|
||||||
source $MYVIMRC
|
source $MYVIMRC
|
||||||
]])
|
]])
|
||||||
vim.notify("Nvim config successfully reloaded!", vim.log.levels.INFO, { title = "nvim-config" })
|
vim.notify("Nvim config successfully reloaded!", vim.log.levels.INFO, { title = "nvim-config" })
|
||||||
end,
|
end, {
|
||||||
|
silent = true,
|
||||||
|
desc = "reload init.lua",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Reselect the text that has just been pasted, see also https://stackoverflow.com/a/4317090/6064933.
|
-- Reselect the text that has just been pasted, see also https://stackoverflow.com/a/4317090/6064933.
|
||||||
@@ -173,25 +173,23 @@ keymap.set({ "x", "o" }, "iu", "<cmd>call text_obj#URL()<cr>", { desc = "URL tex
|
|||||||
keymap.set({ "x", "o" }, "iB", "<cmd>call text_obj#Buffer()<cr>", { desc = "buffer text object" })
|
keymap.set({ "x", "o" }, "iB", "<cmd>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", "", {
|
keymap.set("n", "J", function()
|
||||||
desc = "join line",
|
|
||||||
callback = function()
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
normal! mzJ`z
|
normal! mzJ`z
|
||||||
delmarks z
|
delmarks z
|
||||||
]])
|
]])
|
||||||
end,
|
end, {
|
||||||
|
desc = "join line",
|
||||||
})
|
})
|
||||||
|
|
||||||
keymap.set("n", "gJ", "mzgJ`z", {
|
keymap.set("n", "gJ", function()
|
||||||
desc = "join visual lines",
|
|
||||||
callback = 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! zmgJ`z
|
||||||
delmarks z
|
delmarks z
|
||||||
]])
|
]])
|
||||||
end,
|
end, {
|
||||||
|
desc = "join visual lines",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- 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.
|
||||||
@@ -226,3 +224,22 @@ keymap.set("c", "<C-A>", "<HOME>")
|
|||||||
|
|
||||||
-- Delete the character to the right of the cursor
|
-- Delete the character to the right of the cursor
|
||||||
keymap.set("i", "<C-D>", "<DEL>")
|
keymap.set("i", "<C-D>", "<DEL>")
|
||||||
|
|
||||||
|
keymap.set("n", "<leader>cb", function()
|
||||||
|
local cnt = 0
|
||||||
|
local blink_times = 7
|
||||||
|
local timer = uv.new_timer()
|
||||||
|
|
||||||
|
timer:start(0, 100, vim.schedule_wrap(function()
|
||||||
|
vim.cmd[[
|
||||||
|
set cursorcolumn!
|
||||||
|
set cursorline!
|
||||||
|
]]
|
||||||
|
|
||||||
|
if cnt == blink_times then
|
||||||
|
timer:close()
|
||||||
|
end
|
||||||
|
|
||||||
|
cnt = cnt + 1
|
||||||
|
end))
|
||||||
|
end)
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ 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:‾
|
||||||
|
|
||||||
" Paste mode toggle, it seems that Nvim's bracketed paste mode
|
|
||||||
" does not work very well for nvim-qt, so we use good-old paste mode
|
|
||||||
set pastetoggle=<F12>
|
|
||||||
|
|
||||||
" Split window below/right when creating horizontal/vertical windows
|
" Split window below/right when creating horizontal/vertical windows
|
||||||
set splitbelow splitright
|
set splitbelow splitright
|
||||||
|
|
||||||
@@ -44,9 +40,9 @@ set backup " create backup for files
|
|||||||
set backupcopy=yes " copy the original file to backupdir and overwrite it
|
set backupcopy=yes " copy the original file to backupdir and overwrite it
|
||||||
|
|
||||||
" General tab settings
|
" General tab settings
|
||||||
set tabstop=4 " number of visual spaces per TAB
|
set tabstop=2 " number of visual spaces per TAB
|
||||||
set softtabstop=4 " number of spaces in tab when editing
|
set softtabstop=2 " number of spaces in tab when editing
|
||||||
set shiftwidth=4 " number of spaces to use for autoindent
|
set shiftwidth=2 " 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
|
||||||
|
|
||||||
" Set matching pairs of characters and highlight matching brackets
|
" Set matching pairs of characters and highlight matching brackets
|
||||||
@@ -75,6 +71,7 @@ set scrolloff=3
|
|||||||
" Use mouse to select and resize windows, etc.
|
" Use mouse to select and resize windows, etc.
|
||||||
set mouse=nic " Enable mouse in several mode
|
set mouse=nic " Enable mouse in several mode
|
||||||
set mousemodel=popup " Set the behaviour of mouse
|
set mousemodel=popup " Set the behaviour of mouse
|
||||||
|
set mousescroll=ver:1,hor:6
|
||||||
|
|
||||||
" Disable showing current mode on command line since statusline plugins can show it.
|
" Disable showing current mode on command line since statusline plugins can show it.
|
||||||
set noshowmode
|
set noshowmode
|
||||||
@@ -144,7 +141,7 @@ set formatoptions+=mM
|
|||||||
" Tilde (~) is an operator, thus must be followed by motions like `e` or `w`.
|
" Tilde (~) is an operator, thus must be followed by motions like `e` or `w`.
|
||||||
set tildeop
|
set tildeop
|
||||||
|
|
||||||
set synmaxcol=200 " Text after this column number is not highlighted
|
set synmaxcol=250 " Text after this column number is not highlighted
|
||||||
set nostartofline
|
set nostartofline
|
||||||
|
|
||||||
" External program to use for grep command
|
" External program to use for grep command
|
||||||
@@ -175,6 +172,7 @@ set diffopt+=filler " show filler for deleted lines
|
|||||||
set diffopt+=closeoff " turn off diff when one file window is closed
|
set diffopt+=closeoff " turn off diff when one file window is closed
|
||||||
set diffopt+=context:3 " context for diff
|
set diffopt+=context:3 " context for diff
|
||||||
set diffopt+=internal,indent-heuristic,algorithm:histogram
|
set diffopt+=internal,indent-heuristic,algorithm:histogram
|
||||||
|
set diffopt+=linematch:60
|
||||||
|
|
||||||
set nowrap " do no wrap
|
set nowrap " do no wrap
|
||||||
set noruler
|
set noruler
|
||||||
|
|||||||
@@ -137,31 +137,6 @@ let g:mundo_width = 80
|
|||||||
|
|
||||||
nnoremap <silent> <Space>u :MundoToggle<CR>
|
nnoremap <silent> <Space>u :MundoToggle<CR>
|
||||||
|
|
||||||
""""""""""""""""""""""""""""vim-yoink settings"""""""""""""""""""""""""
|
|
||||||
if g:is_win || g:is_mac
|
|
||||||
" ctrl-n and ctrl-p will not work if you add the TextChanged event to vim-auto-save events.
|
|
||||||
" nmap <c-n> <plug>(YoinkPostPasteSwapBack)
|
|
||||||
" nmap <c-p> <plug>(YoinkPostPasteSwapForward)
|
|
||||||
|
|
||||||
" The following p/P mappings are also needed for ctrl-n and ctrl-p to work
|
|
||||||
" nmap p <plug>(YoinkPaste_p)
|
|
||||||
" nmap P <plug>(YoinkPaste_P)
|
|
||||||
|
|
||||||
" Cycle the yank stack with the following mappings
|
|
||||||
nmap [y <plug>(YoinkRotateBack)
|
|
||||||
nmap ]y <plug>(YoinkRotateForward)
|
|
||||||
|
|
||||||
" Do not change the cursor position
|
|
||||||
nmap y <plug>(YoinkYankPreserveCursorPosition)
|
|
||||||
xmap y <plug>(YoinkYankPreserveCursorPosition)
|
|
||||||
|
|
||||||
" Move cursor to end of paste after multiline paste
|
|
||||||
let g:yoinkMoveCursorToEndOfPaste = 0
|
|
||||||
|
|
||||||
" Record yanks in system clipboard
|
|
||||||
let g:yoinkSyncSystemClipboardOnFocus = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
""""""""""""""""""""""""""""better-escape.vim settings"""""""""""""""""""""""""
|
""""""""""""""""""""""""""""better-escape.vim settings"""""""""""""""""""""""""
|
||||||
let g:better_escape_interval = 200
|
let g:better_escape_interval = 200
|
||||||
|
|
||||||
@@ -243,7 +218,7 @@ nmap s <Nop>
|
|||||||
omap s <Nop>
|
omap s <Nop>
|
||||||
|
|
||||||
""""""""""""""""""""""""""""vimtex settings"""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""vimtex settings"""""""""""""""""""""""""""""
|
||||||
if ( g:is_win || g:is_mac ) && executable('latex')
|
if executable('latex')
|
||||||
" Hacks for inverse search to work semi-automatically,
|
" Hacks for inverse search to work semi-automatically,
|
||||||
" see https://jdhao.github.io/2021/02/20/inverse_search_setup_neovim_vimtex/.
|
" see https://jdhao.github.io/2021/02/20/inverse_search_setup_neovim_vimtex/.
|
||||||
function! s:write_server_name() abort
|
function! s:write_server_name() abort
|
||||||
|
|||||||
@@ -124,27 +124,27 @@ fi
|
|||||||
#######################################################################
|
#######################################################################
|
||||||
# lua-language-server #
|
# lua-language-server #
|
||||||
#######################################################################
|
#######################################################################
|
||||||
SUMNEKO_LUA_DIR=$HOME/tools/lua-language-server
|
LUA_LS_DIR=$HOME/tools/lua-language-server
|
||||||
SUMNEKO_LUA_SRC_NAME=$HOME/packages/lua-language-server.tar.gz
|
LUA_LS_SRC=$HOME/packages/lua-language-server.tar.gz
|
||||||
SUMNEKO_LUA_LINK="https://github.com/sumneko/lua-language-server/releases/download/3.5.3/lua-language-server-3.5.3-linux-x64.tar.gz"
|
LUA_LS_LINK="https://github.com/LuaLS/lua-language-server/releases/download/3.6.11/lua-language-server-3.6.11-linux-x64.tar.gz"
|
||||||
|
|
||||||
if [[ -z "$(command -v lua-language-server)" ]] && [[ ! -f "$SUMNEKO_LUA_DIR/bin/lua-language-server" ]]; then
|
if [[ -z "$(command -v lua-language-server)" ]] && [[ ! -f "$LUA_LS_DIR/bin/lua-language-server" ]]; then
|
||||||
echo 'Install lua-language-server'
|
echo 'Install lua-language-server'
|
||||||
if [[ ! -f $SUMNEKO_LUA_SRC_NAME ]]; then
|
if [[ ! -f $LUA_LS_SRC ]]; then
|
||||||
echo "Downloading lua-language-server and renaming"
|
echo "Downloading lua-language-server and renaming"
|
||||||
wget $SUMNEKO_LUA_LINK -O "$SUMNEKO_LUA_SRC_NAME"
|
wget $LUA_LS_LINK -O "$LUA_LS_SRC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d "$SUMNEKO_LUA_DIR" ]]; then
|
if [[ ! -d "$LUA_LS_DIR" ]]; then
|
||||||
echo "Creating lua-language-server directory under tools directory"
|
echo "Creating lua-language-server directory under tools directory"
|
||||||
mkdir -p "$SUMNEKO_LUA_DIR"
|
mkdir -p "$LUA_LS_DIR"
|
||||||
echo "Extracting to directory $SUMNEKO_LUA_DIR"
|
echo "Extracting to directory $LUA_LS_DIR"
|
||||||
|
|
||||||
tar zxvf "$SUMNEKO_LUA_SRC_NAME" -C "$SUMNEKO_LUA_DIR"
|
tar zxvf "$LUA_LS_SRC" -C "$LUA_LS_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$ADD_TO_SYSTEM_PATH" = true ]] && [[ "$USE_BASH_SHELL" = true ]]; then
|
if [[ "$ADD_TO_SYSTEM_PATH" = true ]] && [[ "$USE_BASH_SHELL" = true ]]; then
|
||||||
echo "export PATH=\"$SUMNEKO_LUA_DIR/bin:\$PATH\"" >> "$HOME/.bash_profile"
|
echo "export PATH=\"$LUA_LS_DIR/bin:\$PATH\"" >> "$HOME/.bash_profile"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "lua-language-server is already installed. Skip installing it."
|
echo "lua-language-server is already installed. Skip installing it."
|
||||||
|
|||||||
@@ -36,19 +36,19 @@ scoop install vcredist2022
|
|||||||
scoop install 7zip
|
scoop install 7zip
|
||||||
|
|
||||||
# Install lua-language-server
|
# Install lua-language-server
|
||||||
$sumneko_lua_link = "https://github.com/sumneko/lua-language-server/releases/download/3.5.3/lua-language-server-3.5.3-win32-x64.zip"
|
$lua_ls_link = "https://github.com/LuaLS/lua-language-server/releases/download/3.6.11/lua-language-server-3.6.11-win32-x64.zip"
|
||||||
$sumneko_lua_install_dir = "D:\portable_tools"
|
$lua_ls_install_dir = "D:\portable_tools"
|
||||||
$sumneko_lua_src_dir = "$sumneko_lua_install_dir\lua-language-server.zip"
|
$lua_ls_src_path = "$lua_ls_install_dir\lua-language-server.zip"
|
||||||
$sumneko_lua_dir = "$sumneko_lua_install_dir\lua-language-server"
|
$lua_ls_dir = "$lua_ls_install_dir\lua-language-server"
|
||||||
|
|
||||||
# Download file, ref: https://stackoverflow.com/a/51225744/6064933
|
# Download file, ref: https://stackoverflow.com/a/51225744/6064933
|
||||||
Invoke-WebRequest $sumneko_lua_link -OutFile "$sumneko_lua_src_dir"
|
Invoke-WebRequest $lua_ls_link -OutFile "$lua_ls_src_path"
|
||||||
|
|
||||||
# Extract the zip file using 7zip, ref: https://stackoverflow.com/a/41933215/6064933
|
# Extract the zip file using 7zip, ref: https://stackoverflow.com/a/41933215/6064933
|
||||||
7z x "$sumneko_lua_src_dir" -o"$sumneko_lua_dir"
|
7z x "$lua_ls_src_path" -o"$lua_ls_dir"
|
||||||
|
|
||||||
# Setup PATH env variable, ref: https://stackoverflow.com/q/714877/6064933
|
# Setup PATH env variable, ref: https://stackoverflow.com/q/714877/6064933
|
||||||
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$sumneko_lua_dir\bin", "Machine")
|
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$lua_ls_dir\bin", "Machine")
|
||||||
|
|
||||||
# Install neovim nightly
|
# Install neovim nightly
|
||||||
scoop bucket add versions
|
scoop bucket add versions
|
||||||
|
|||||||
16
init.lua
16
init.lua
@@ -4,19 +4,23 @@
|
|||||||
-- I would not recommend cloning this repo and replace your own config. Good configurations are personal,
|
-- I would not recommend cloning this repo and replace your own config. Good configurations are personal,
|
||||||
-- built over time with a lot of polish.
|
-- built over time with a lot of polish.
|
||||||
--
|
--
|
||||||
-- Author: Jie-dong Hao
|
-- Author: Jiedong Hao
|
||||||
-- Email: jdhao@hotmail.com
|
-- Email: jdhao@hotmail.com
|
||||||
-- Blog: https://jdhao.github.io/
|
-- Blog: https://jdhao.github.io/
|
||||||
|
-- GitHub: https://github.com/jdhao
|
||||||
|
-- StackOverflow: https://stackoverflow.com/users/6064933/jdhao
|
||||||
|
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
local utils = require("utils")
|
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.8.0"
|
local expected_ver = "0.9.0"
|
||||||
local nvim_ver = utils.get_nvim_version()
|
local ev = version.parse(expected_ver)
|
||||||
|
local actual_ver = version()
|
||||||
|
|
||||||
if nvim_ver ~= expected_ver then
|
if version.cmp(ev, actual_ver) ~= 0 then
|
||||||
local msg = string.format("Unsupported nvim version: expect %s, but got %s instead!", expected_ver, nvim_ver)
|
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)
|
||||||
api.nvim_err_writeln(msg)
|
api.nvim_err_writeln(msg)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
local api = vim.api
|
||||||
|
local keymap = vim.keymap
|
||||||
local dashboard = require("dashboard")
|
local dashboard = require("dashboard")
|
||||||
|
|
||||||
dashboard.custom_header = {
|
dashboard.custom_header = {
|
||||||
@@ -56,10 +58,11 @@ dashboard.custom_center = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.cmd([[
|
api.nvim_create_autocmd("FileType", {
|
||||||
augroup dashboard_enter
|
pattern = "dashboard",
|
||||||
au!
|
group = api.nvim_create_augroup("dashboard_enter", { clear = true }),
|
||||||
autocmd FileType dashboard nnoremap <buffer> q :qa<CR>
|
callback = function ()
|
||||||
autocmd FileType dashboard nnoremap <buffer> e :enew<CR>
|
keymap.set("n", "q", ":qa<CR>", { buffer = true, silent = true })
|
||||||
augroup END
|
keymap.set("n", "e", ":enew<CR>", { buffer = true, silent = true })
|
||||||
]])
|
end
|
||||||
|
})
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ vim.api.nvim_create_autocmd('ColorScheme', {
|
|||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
hi GitSignsChangeInline guibg=fg guifg=bg
|
hi GitSignsChangeInline gui=reverse
|
||||||
hi GitSignsAddInline guibg=fg guifg=bg
|
hi GitSignsAddInline gui=reverse
|
||||||
hi GitSignsDeleteInline guibg=fg guifg=bg
|
hi GitSignsDeleteInline gui=reverse
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -34,5 +34,15 @@ keymap.set("n", "N", "", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
keymap.set("n", "*", "<Plug>(asterisk-z*)<Cmd>lua require('hlslens').start()<CR>")
|
keymap.set("n", "*", "", {
|
||||||
keymap.set("n", "#", "<Plug>(asterisk-z#)<Cmd>lua require('hlslens').start()<CR>")
|
callback = function()
|
||||||
|
vim.fn.execute("normal! *N")
|
||||||
|
hlslens.start()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
keymap.set("n", "#", "", {
|
||||||
|
callback = function()
|
||||||
|
vim.fn.execute("normal! #N")
|
||||||
|
hlslens.start()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ local fn = vim.fn
|
|||||||
local api = vim.api
|
local api = vim.api
|
||||||
local keymap = vim.keymap
|
local keymap = vim.keymap
|
||||||
local lsp = vim.lsp
|
local lsp = vim.lsp
|
||||||
|
local diagnostic = vim.diagnostic
|
||||||
|
|
||||||
local utils = require("utils")
|
local utils = require("utils")
|
||||||
|
|
||||||
@@ -20,11 +21,9 @@ local custom_attach = function(client, bufnr)
|
|||||||
map("n", "<C-k>", vim.lsp.buf.signature_help)
|
map("n", "<C-k>", vim.lsp.buf.signature_help)
|
||||||
map("n", "<space>rn", vim.lsp.buf.rename, { desc = "varialbe rename" })
|
map("n", "<space>rn", vim.lsp.buf.rename, { desc = "varialbe rename" })
|
||||||
map("n", "gr", vim.lsp.buf.references, { desc = "show references" })
|
map("n", "gr", vim.lsp.buf.references, { desc = "show references" })
|
||||||
map("n", "[d", vim.diagnostic.goto_prev, { desc = "previous diagnostic" })
|
map("n", "[d", diagnostic.goto_prev, { desc = "previous diagnostic" })
|
||||||
map("n", "]d", vim.diagnostic.goto_next, { desc = "next diagnostic" })
|
map("n", "]d", diagnostic.goto_next, { desc = "next diagnostic" })
|
||||||
map("n", "<space>q", function()
|
map("n", "<space>q", diagnostic.setqflist, { desc = "put diagnostic to qf" })
|
||||||
vim.diagnostic.setqflist { open = true }
|
|
||||||
end, { desc = "put diagnostic to qf" })
|
|
||||||
map("n", "<space>ca", vim.lsp.buf.code_action, { desc = "LSP code action" })
|
map("n", "<space>ca", vim.lsp.buf.code_action, { desc = "LSP code action" })
|
||||||
map("n", "<space>wa", vim.lsp.buf.add_workspace_folder, { desc = "add workspace folder" })
|
map("n", "<space>wa", vim.lsp.buf.add_workspace_folder, { desc = "add workspace folder" })
|
||||||
map("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, { desc = "remove workspace folder" })
|
map("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, { desc = "remove workspace folder" })
|
||||||
@@ -54,9 +53,9 @@ local custom_attach = function(client, bufnr)
|
|||||||
|
|
||||||
local cursor_pos = api.nvim_win_get_cursor(0)
|
local cursor_pos = api.nvim_win_get_cursor(0)
|
||||||
if (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2])
|
if (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2])
|
||||||
and #vim.diagnostic.get() > 0
|
and #diagnostic.get() > 0
|
||||||
then
|
then
|
||||||
vim.diagnostic.open_float(nil, float_opts)
|
diagnostic.open_float(nil, float_opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.b.diagnostics_pos = cursor_pos
|
vim.b.diagnostics_pos = cursor_pos
|
||||||
@@ -69,12 +68,24 @@ local custom_attach = function(client, bufnr)
|
|||||||
hi! link LspReferenceRead Visual
|
hi! link LspReferenceRead Visual
|
||||||
hi! link LspReferenceText Visual
|
hi! link LspReferenceText Visual
|
||||||
hi! link LspReferenceWrite Visual
|
hi! link LspReferenceWrite Visual
|
||||||
augroup lsp_document_highlight
|
|
||||||
autocmd! * <buffer>
|
|
||||||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
|
||||||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
|
||||||
augroup END
|
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
local gid = api.nvim_create_augroup("lsp_document_highlight", { clear = true })
|
||||||
|
api.nvim_create_autocmd("CursorHold" , {
|
||||||
|
group = gid,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function ()
|
||||||
|
lsp.buf.document_highlight()
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
api.nvim_create_autocmd("CursorMoved" , {
|
||||||
|
group = gid,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function ()
|
||||||
|
lsp.buf.clear_references()
|
||||||
|
end
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.g.logging_level == "debug" then
|
if vim.g.logging_level == "debug" then
|
||||||
@@ -83,9 +94,7 @@ local custom_attach = function(client, bufnr)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local capabilities = lsp.protocol.make_client_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
@@ -122,6 +131,20 @@ end
|
|||||||
-- vim.notify("pyright not found!", vim.log.levels.WARN, {title = 'Nvim-config'})
|
-- vim.notify("pyright not found!", vim.log.levels.WARN, {title = 'Nvim-config'})
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
|
if utils.executable("ltex-ls") then
|
||||||
|
lspconfig.ltex.setup {
|
||||||
|
on_attach = custom_attach,
|
||||||
|
cmd = { "ltex-ls" },
|
||||||
|
filetypes = { "text", "plaintex", "tex", "markdown" },
|
||||||
|
settings = {
|
||||||
|
ltex = {
|
||||||
|
language = "en"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
flags = { debounce_text_changes = 300 },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
if utils.executable("clangd") then
|
if utils.executable("clangd") then
|
||||||
lspconfig.clangd.setup {
|
lspconfig.clangd.setup {
|
||||||
on_attach = custom_attach,
|
on_attach = custom_attach,
|
||||||
@@ -131,8 +154,6 @@ if utils.executable("clangd") then
|
|||||||
debounce_text_changes = 500,
|
debounce_text_changes = 500,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
else
|
|
||||||
vim.notify("clangd not found!", vim.log.levels.WARN, { title = "Nvim-config" })
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set up vim-language-server
|
-- set up vim-language-server
|
||||||
@@ -157,8 +178,8 @@ if utils.executable("bash-language-server") then
|
|||||||
end
|
end
|
||||||
|
|
||||||
if utils.executable("lua-language-server") then
|
if utils.executable("lua-language-server") then
|
||||||
-- settings for lua-language-server can be found on https://github.com/sumneko/lua-language-server/wiki/Settings .
|
-- settings for lua-language-server can be found on https://github.com/LuaLS/lua-language-server/wiki/Settings .
|
||||||
lspconfig.sumneko_lua.setup {
|
lspconfig.lua_ls.setup {
|
||||||
on_attach = custom_attach,
|
on_attach = custom_attach,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
@@ -172,8 +193,8 @@ if utils.executable("lua-language-server") then
|
|||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
-- Make the server aware of Neovim runtime files,
|
-- Make the server aware of Neovim runtime files,
|
||||||
-- see also https://github.com/sumneko/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 sumneko lua, https://github.com/folke/lua-dev.nvim/blob/main/lua/lua-dev/sumneko.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") .. "/site/pack/packer/opt/emmylua-nvim",
|
fn.stdpath("data") .. "/site/pack/packer/opt/emmylua-nvim",
|
||||||
fn.stdpath("config"),
|
fn.stdpath("config"),
|
||||||
@@ -194,7 +215,7 @@ fn.sign_define("DiagnosticSignInformation", { text = "", texthl = "Diagnostic
|
|||||||
fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
||||||
|
|
||||||
-- global config for diagnostic
|
-- global config for diagnostic
|
||||||
vim.diagnostic.config {
|
diagnostic.config {
|
||||||
underline = false,
|
underline = false,
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
signs = true,
|
signs = true,
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
require("neoscroll").setup {
|
|
||||||
easing_function = "quadratic",
|
|
||||||
}
|
|
||||||
|
|
||||||
local t = {}
|
|
||||||
-- Syntax: t[keys] = {function, {function arguments}}
|
|
||||||
-- Use the "sine" easing function
|
|
||||||
t["<C-u>"] = { "scroll", { "-vim.wo.scroll", "true", "20", [['cubic']] } }
|
|
||||||
t["<C-d>"] = { "scroll", { "vim.wo.scroll", "true", "20", [['cubic']] } }
|
|
||||||
-- Use the "circular" easing function
|
|
||||||
t["<C-b>"] = { "scroll", { "-vim.api.nvim_win_get_height(0)", "true", "50", [['cubic']] } }
|
|
||||||
t["<C-f>"] = { "scroll", { "vim.api.nvim_win_get_height(0)", "true", "50", [['cubic']] } }
|
|
||||||
-- Pass "nil" to disable the easing animation (constant scrolling speed)
|
|
||||||
t["<C-y>"] = { "scroll", { "-0.10", "false", "100", nil } }
|
|
||||||
t["<C-e>"] = { "scroll", { "0.10", "false", "100", nil } }
|
|
||||||
-- When no easing function is provided the default easing function (in this case "quadratic") will be used
|
|
||||||
t["zt"] = { "zt", { "10" } }
|
|
||||||
t["zz"] = { "zz", { "10" } }
|
|
||||||
t["zb"] = { "zb", { "10" } }
|
|
||||||
|
|
||||||
require("neoscroll.config").set_mappings(t)
|
|
||||||
@@ -35,7 +35,6 @@ cmp.setup {
|
|||||||
{ name = "ultisnips" }, -- For ultisnips user.
|
{ name = "ultisnips" }, -- For ultisnips user.
|
||||||
{ name = "path" }, -- for path completion
|
{ name = "path" }, -- for path completion
|
||||||
{ name = "buffer", keyword_length = 2 }, -- for buffer word completion
|
{ name = "buffer", keyword_length = 2 }, -- for buffer word completion
|
||||||
{ name = "omni" },
|
|
||||||
{ name = "emoji", insert = true }, -- emoji completion
|
{ name = "emoji", insert = true }, -- emoji completion
|
||||||
},
|
},
|
||||||
completion = {
|
completion = {
|
||||||
@@ -61,6 +60,15 @@ cmp.setup {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmp.setup.filetype("tex", {
|
||||||
|
sources = {
|
||||||
|
{ name = "omni" },
|
||||||
|
{ name = "ultisnips" }, -- For ultisnips user.
|
||||||
|
{ name = "buffer", keyword_length = 2 }, -- for buffer word completion
|
||||||
|
{ name = "path" }, -- for path completion
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- see https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-dark-theme-colors-to-the-menu
|
-- see https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-dark-theme-colors-to-the-menu
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
highlight! link CmpItemMenu Comment
|
highlight! link CmpItemMenu Comment
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ nvim_tree.setup {
|
|||||||
hijack_cursor = false,
|
hijack_cursor = false,
|
||||||
hijack_netrw = true,
|
hijack_netrw = true,
|
||||||
hijack_unnamed_buffer_when_opening = false,
|
hijack_unnamed_buffer_when_opening = false,
|
||||||
ignore_buffer_on_setup = false,
|
|
||||||
open_on_setup = false,
|
|
||||||
open_on_setup_file = false,
|
|
||||||
open_on_tab = false,
|
open_on_tab = false,
|
||||||
sort_by = "name",
|
sort_by = "name",
|
||||||
update_cwd = false,
|
update_cwd = false,
|
||||||
@@ -50,7 +47,6 @@ nvim_tree.setup {
|
|||||||
update_cwd = false,
|
update_cwd = false,
|
||||||
ignore_list = {},
|
ignore_list = {},
|
||||||
},
|
},
|
||||||
ignore_ft_on_setup = {},
|
|
||||||
system_open = {
|
system_open = {
|
||||||
cmd = "",
|
cmd = "",
|
||||||
args = {},
|
args = {},
|
||||||
@@ -113,6 +109,7 @@ nvim_tree.setup {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
keymap.set("n", "<space>s", function()
|
keymap.set("n", "<space>s", require("nvim-tree.api").tree.toggle, {
|
||||||
return require("nvim-tree").toggle(false, true)
|
silent = true,
|
||||||
end, { silent = true, desc = "toggle nvim-tree" })
|
desc = "toggle nvim-tree",
|
||||||
|
})
|
||||||
|
|||||||
@@ -8,11 +8,17 @@ local function spell()
|
|||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- show indicator for Chinese IME
|
||||||
local function ime_state()
|
local function ime_state()
|
||||||
if vim.g.is_mac then
|
if vim.g.is_mac then
|
||||||
-- ref: https://github.com/vim-airline/vim-airline/blob/master/autoload/airline/extensions/xkblayout.vim#L11
|
-- ref: https://github.com/vim-airline/vim-airline/blob/master/autoload/airline/extensions/xkblayout.vim#L11
|
||||||
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
||||||
if layout == "0" then
|
|
||||||
|
-- We can use `xkbswitch -g` on the command line to get current mode.
|
||||||
|
-- mode for macOS builtin pinyin IME: com.apple.inputmethod.SCIM.ITABC
|
||||||
|
-- mode for Rime: im.rime.inputmethod.Squirrel.Rime
|
||||||
|
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
|
||||||
|
if res ~= -1 then
|
||||||
return "[CN]"
|
return "[CN]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -87,7 +93,7 @@ local diff = function()
|
|||||||
local add_num = git_status.added
|
local add_num = git_status.added
|
||||||
|
|
||||||
local info = { added = add_num, modified = modify_num, removed = remove_num }
|
local info = { added = add_num, modified = modify_num, removed = remove_num }
|
||||||
-- vim.pretty_print(info)
|
-- vim.print(info)
|
||||||
return info
|
return info
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
13
lua/config/yanky.lua
Normal file
13
lua/config/yanky.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
require("yanky").setup({
|
||||||
|
ring = {
|
||||||
|
history_length = 50,
|
||||||
|
storage = "memory",
|
||||||
|
},
|
||||||
|
preserve_cursor_position = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- cycle through the yank history, only work after paste
|
||||||
|
vim.keymap.set("n", "[y", "<Plug>(YankyCycleForward)")
|
||||||
|
vim.keymap.set("n", "]y", "<Plug>(YankyCycleBackward)")
|
||||||
@@ -25,17 +25,6 @@ api.nvim_create_autocmd({ "TextYankPost" }, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Auto-generate packer_compiled.lua file
|
|
||||||
api.nvim_create_autocmd({ "BufWritePost" }, {
|
|
||||||
pattern = "*/nvim/lua/plugins.lua",
|
|
||||||
group = api.nvim_create_augroup("packer_auto_compile", { clear = true }),
|
|
||||||
callback = function(ctx)
|
|
||||||
local cmd = "source " .. ctx.file
|
|
||||||
vim.cmd(cmd)
|
|
||||||
vim.cmd("PackerCompile")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Auto-create dir when saving a file, in case some intermediate directory does not exist
|
-- Auto-create dir when saving a file, in case some intermediate directory does not exist
|
||||||
api.nvim_create_autocmd({ "BufWritePre" }, {
|
api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
|
|||||||
@@ -1,27 +1,35 @@
|
|||||||
local utils = require("utils")
|
local api = vim.api
|
||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
|
|
||||||
|
local utils = require("utils")
|
||||||
|
|
||||||
-- The root dir to install all plugins. Plugins are under opt/ or start/ sub-directory.
|
-- The root dir to install all plugins. Plugins are under opt/ or start/ sub-directory.
|
||||||
vim.g.plugin_home = fn.stdpath("data") .. "/site/pack/packer"
|
vim.g.plugin_home = fn.stdpath("data") .. "/site/pack/packer"
|
||||||
|
|
||||||
|
--- Install packer if it has not been installed.
|
||||||
|
--- Return:
|
||||||
|
--- true: if this is a fresh install of packer
|
||||||
|
--- false: if packer has been installed
|
||||||
|
local function packer_ensure_install()
|
||||||
-- Where to install packer.nvim -- the package manager (we make it opt)
|
-- Where to install packer.nvim -- the package manager (we make it opt)
|
||||||
local packer_dir = vim.g.plugin_home .. "/opt/packer.nvim"
|
local packer_dir = vim.g.plugin_home .. "/opt/packer.nvim"
|
||||||
|
|
||||||
-- Whether this is a fresh install, i.e., packer itself and plugins have not been installed.
|
if fn.glob(packer_dir) ~= "" then
|
||||||
local fresh_install = false
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
-- Auto-install packer in case it hasn't been installed.
|
-- Auto-install packer in case it hasn't been installed.
|
||||||
if fn.glob(packer_dir) == "" then
|
vim.api.nvim_echo({ { "Installing packer.nvim", "Type" } }, true, {})
|
||||||
fresh_install = true
|
|
||||||
|
|
||||||
-- Now we need to install packer.nvim first.
|
|
||||||
local packer_repo = "https://github.com/wbthomason/packer.nvim"
|
local packer_repo = "https://github.com/wbthomason/packer.nvim"
|
||||||
local install_cmd = string.format("!git clone --depth=1 %s %s", packer_repo, packer_dir)
|
local install_cmd = string.format("!git clone --depth=1 %s %s", packer_repo, packer_dir)
|
||||||
|
|
||||||
vim.api.nvim_echo({ { "Installing packer.nvim", "Type" } }, true, {})
|
|
||||||
vim.cmd(install_cmd)
|
vim.cmd(install_cmd)
|
||||||
|
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local fresh_install = packer_ensure_install()
|
||||||
|
|
||||||
-- Load packer.nvim
|
-- Load packer.nvim
|
||||||
vim.cmd("packadd packer.nvim")
|
vim.cmd("packadd packer.nvim")
|
||||||
|
|
||||||
@@ -99,9 +107,6 @@ packer.startup {
|
|||||||
config = [[require('config.hlslens')]],
|
config = [[require('config.hlslens')]],
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Stay after pressing * and search selected text
|
|
||||||
use { "haya14busa/vim-asterisk", event = "VimEnter" }
|
|
||||||
|
|
||||||
-- File search, tag search and more
|
-- File search, tag search and more
|
||||||
if vim.g.is_win then
|
if vim.g.is_win then
|
||||||
use { "Yggdroot/LeaderF", cmd = "Leaderf" }
|
use { "Yggdroot/LeaderF", cmd = "Leaderf" }
|
||||||
@@ -118,19 +123,21 @@ packer.startup {
|
|||||||
use { "nvim-telescope/telescope-symbols.nvim", after = "telescope.nvim" }
|
use { "nvim-telescope/telescope-symbols.nvim", after = "telescope.nvim" }
|
||||||
|
|
||||||
-- 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.
|
||||||
use { "lifepillar/vim-gruvbox8", opt = true }
|
|
||||||
use { "navarasu/onedark.nvim", opt = true }
|
use { "navarasu/onedark.nvim", opt = true }
|
||||||
use { "sainnhe/edge", opt = true }
|
use { "sainnhe/edge", opt = true }
|
||||||
use { "sainnhe/sonokai", opt = true }
|
use { "sainnhe/sonokai", opt = true }
|
||||||
use { "sainnhe/gruvbox-material", opt = true }
|
use { "sainnhe/gruvbox-material", opt = true }
|
||||||
use { "shaunsingh/nord.nvim", opt = true }
|
use { "shaunsingh/nord.nvim", opt = true }
|
||||||
use { "NTBBloodbath/doom-one.nvim", opt = true }
|
|
||||||
use { "sainnhe/everforest", opt = true }
|
use { "sainnhe/everforest", opt = true }
|
||||||
use { "EdenEast/nightfox.nvim", opt = true }
|
use { "EdenEast/nightfox.nvim", opt = true }
|
||||||
use { "rebelot/kanagawa.nvim", opt = true }
|
use { "rebelot/kanagawa.nvim", opt = true }
|
||||||
use { "catppuccin/nvim", as = "catppuccin", opt = true }
|
use { "catppuccin/nvim", as = "catppuccin", opt = true }
|
||||||
|
use({ "rose-pine/neovim", as = 'rose-pine', opt = true })
|
||||||
|
use { "olimorris/onedarkpro.nvim", opt = true }
|
||||||
|
use { "tanvirtin/monokai.nvim", opt = true }
|
||||||
|
use { "marko-cerovac/material.nvim", opt = true }
|
||||||
|
|
||||||
use { "kyazdani42/nvim-web-devicons", event = "VimEnter" }
|
use { "nvim-tree/nvim-web-devicons", event = "VimEnter" }
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
@@ -201,10 +208,14 @@ packer.startup {
|
|||||||
-- Show undo history visually
|
-- Show undo history visually
|
||||||
use { "simnalamburt/vim-mundo", cmd = { "MundoToggle", "MundoShow" } }
|
use { "simnalamburt/vim-mundo", cmd = { "MundoToggle", "MundoShow" } }
|
||||||
|
|
||||||
|
-- better UI for some nvim actions
|
||||||
|
use {'stevearc/dressing.nvim'}
|
||||||
|
|
||||||
-- Manage your yank history
|
-- Manage your yank history
|
||||||
if vim.g.is_win or vim.g.is_mac then
|
use({
|
||||||
use { "svermeulen/vim-yoink", event = "VimEnter" }
|
"gbprod/yanky.nvim",
|
||||||
end
|
config = [[require('config.yanky')]]
|
||||||
|
})
|
||||||
|
|
||||||
-- Handy unix command inside Vim (Rename, Move etc.)
|
-- Handy unix command inside Vim (Rename, Move etc.)
|
||||||
use { "tpope/vim-eunuch", cmd = { "Rename", "Delete" } }
|
use { "tpope/vim-eunuch", cmd = { "Rename", "Delete" } }
|
||||||
@@ -255,9 +266,6 @@ packer.startup {
|
|||||||
-- Vim tabular plugin for manipulate tabular, required by markdown plugins
|
-- Vim tabular plugin for manipulate tabular, required by markdown plugins
|
||||||
use { "godlygeek/tabular", cmd = { "Tabularize" } }
|
use { "godlygeek/tabular", cmd = { "Tabularize" } }
|
||||||
|
|
||||||
-- Markdown JSON header highlight plugin
|
|
||||||
use { "elzr/vim-json", ft = { "json", "markdown" } }
|
|
||||||
|
|
||||||
-- Markdown previewing (only for Mac and Windows)
|
-- Markdown previewing (only for Mac and Windows)
|
||||||
if vim.g.is_win or vim.g.is_mac then
|
if vim.g.is_win or vim.g.is_mac then
|
||||||
use {
|
use {
|
||||||
@@ -286,7 +294,7 @@ packer.startup {
|
|||||||
use { "michaeljsmith/vim-indent-object", event = "VimEnter" }
|
use { "michaeljsmith/vim-indent-object", event = "VimEnter" }
|
||||||
|
|
||||||
-- 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
|
||||||
if vim.g.is_win or vim.g.is_mac and utils.executable("latex") then
|
if utils.executable("latex") then
|
||||||
use { "lervag/vimtex", ft = { "tex" } }
|
use { "lervag/vimtex", ft = { "tex" } }
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -300,17 +308,6 @@ packer.startup {
|
|||||||
-- Modern matchit implementation
|
-- Modern matchit implementation
|
||||||
use { "andymass/vim-matchup", event = "VimEnter" }
|
use { "andymass/vim-matchup", event = "VimEnter" }
|
||||||
|
|
||||||
-- Smoothie motions
|
|
||||||
use {
|
|
||||||
"karb94/neoscroll.nvim",
|
|
||||||
event = "VimEnter",
|
|
||||||
config = function()
|
|
||||||
vim.defer_fn(function()
|
|
||||||
require("config.neoscroll")
|
|
||||||
end, 2000)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
use { "tpope/vim-scriptease", cmd = { "Scriptnames", "Message", "Verbose" } }
|
use { "tpope/vim-scriptease", cmd = { "Scriptnames", "Message", "Verbose" } }
|
||||||
|
|
||||||
-- Asynchronous command execution
|
-- Asynchronous command execution
|
||||||
@@ -361,8 +358,8 @@ packer.startup {
|
|||||||
|
|
||||||
-- file explorer
|
-- file explorer
|
||||||
use {
|
use {
|
||||||
"kyazdani42/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
requires = { "kyazdani42/nvim-web-devicons" },
|
requires = { "nvim-tree/nvim-web-devicons" },
|
||||||
config = [[require('config.nvim-tree')]],
|
config = [[require('config.nvim-tree')]],
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,3 +385,15 @@ else
|
|||||||
vim.notify(msg, vim.log.levels.ERROR, { title = "nvim-config" })
|
vim.notify(msg, vim.log.levels.ERROR, { title = "nvim-config" })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Auto-generate packer_compiled.lua file
|
||||||
|
api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
|
pattern = "*/nvim/lua/plugins.lua",
|
||||||
|
group = api.nvim_create_augroup("packer_auto_compile", { clear = true }),
|
||||||
|
callback = function(ctx)
|
||||||
|
local cmd = "source " .. ctx.file
|
||||||
|
vim.cmd(cmd)
|
||||||
|
vim.cmd("PackerCompile")
|
||||||
|
vim.notify("PackerCompile done!", vim.log.levels.INFO, { title = "Nvim-config" })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
@@ -31,13 +31,6 @@ function M.may_create_dir(dir)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.get_nvim_version()
|
|
||||||
local actual_ver = vim.version()
|
|
||||||
|
|
||||||
local nvim_ver_str = string.format("%d.%d.%d", actual_ver.major, actual_ver.minor, actual_ver.patch)
|
|
||||||
return nvim_ver_str
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Generate random integers in the range [Low, High], inclusive,
|
--- Generate random integers in the range [Low, High], inclusive,
|
||||||
--- adapted from https://stackoverflow.com/a/12739441/6064933
|
--- adapted from https://stackoverflow.com/a/12739441/6064933
|
||||||
--- @low: the lower value for this range
|
--- @low: the lower value for this range
|
||||||
|
|||||||
3
plugin/abbrev.vim
Normal file
3
plugin/abbrev.vim
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
" some abbreviations
|
||||||
|
iabbrev reqire require
|
||||||
|
iabbrev serveral several
|
||||||
@@ -194,7 +194,6 @@ wiki
|
|||||||
backticks
|
backticks
|
||||||
Reddit
|
Reddit
|
||||||
LeaderF
|
LeaderF
|
||||||
gruvbox8
|
|
||||||
tabpage
|
tabpage
|
||||||
ccls
|
ccls
|
||||||
cmake
|
cmake
|
||||||
@@ -203,6 +202,8 @@ llvm
|
|||||||
subsampling
|
subsampling
|
||||||
refactor
|
refactor
|
||||||
colorschemes
|
colorschemes
|
||||||
|
gruvbox8
|
||||||
|
gruvbox
|
||||||
Gruvbox
|
Gruvbox
|
||||||
monokai
|
monokai
|
||||||
NeoSolarized
|
NeoSolarized
|
||||||
@@ -440,3 +441,20 @@ Postgres
|
|||||||
plpgsql
|
plpgsql
|
||||||
postgres
|
postgres
|
||||||
PySpark
|
PySpark
|
||||||
|
winbar
|
||||||
|
cmdline
|
||||||
|
shada
|
||||||
|
async
|
||||||
|
localhost
|
||||||
|
JetBrains
|
||||||
|
localhost
|
||||||
|
MariaDB
|
||||||
|
SQLite
|
||||||
|
Pgadmin
|
||||||
|
Datagrip
|
||||||
|
mysql
|
||||||
|
cwd
|
||||||
|
pyright
|
||||||
|
stubgen
|
||||||
|
pylance
|
||||||
|
variadic
|
||||||
|
|||||||
Reference in New Issue
Block a user