Compare commits

..

No commits in common. "nvim-init-mac" and "main" have entirely different histories.

41 changed files with 370 additions and 392 deletions

5
.gitignore vendored
View File

@ -1 +1,4 @@
lazy-lock.json
backup/
swap/
undo/
.netrwhist

48
.gitmodules vendored Normal file
View File

@ -0,0 +1,48 @@
[submodule "pack/plugin/opt/vim-easymotion"]
path = pack/plugin/opt/vim-easymotion
url = https://github.com/easymotion/vim-easymotion.git
[submodule "pack/plugin/start/vim-fugitive"]
path = pack/plugin/start/vim-fugitive
url = https://github.com/tpope/vim-fugitive.git
[submodule "pack/plugin/opt/nerdtree"]
path = pack/plugin/opt/nerdtree
url = https://github.com/preservim/nerdtree.git
[submodule "pack/plugin/start/ale"]
path = pack/plugin/start/ale
url = https://github.com/dense-analysis/ale.git
[submodule "pack/colors/start/catppuccin"]
path = pack/colors/start/catppuccin
url = git@github.com:catppuccin/vim.git
[submodule "pack/plugin/start/speeddating"]
path = pack/plugin/start/speeddating
url = https://tpope.io/vim/speeddating.git
[submodule "pack/plugin/start/repeat"]
path = pack/plugin/start/repeat
url = https://tpope.io/vim/repeat.git
[submodule "pack/ftplugin/start/typst.vim"]
path = pack/ftplugin/start/typst.vim
url = https://github.com/kaarmu/typst.vim.git
[submodule "pack/ftplugin/start/vim-orgmode"]
path = pack/ftplugin/start/vim-orgmode
url = https://github.com/jceb/vim-orgmode.git
[submodule "pack/plugin/start/vim-surround"]
path = pack/plugin/start/vim-surround
url = https://github.com/tpope/vim-surround.git
[submodule "pack/plugin/start/vim-commentary"]
path = pack/plugin/start/vim-commentary
url = https://github.com/tpope/vim-commentary.git
[submodule "pack/plugin/start/vim-ReplaceWithRegister"]
path = pack/plugin/start/vim-ReplaceWithRegister
url = https://github.com/inkarkat/vim-ReplaceWithRegister.git
[submodule "pack/plugin/opt/airline"]
path = pack/plugin/opt/airline
url = https://github.com/vim-airline/vim-airline
[submodule "pack/plugin/opt/airline-themes"]
path = pack/plugin/opt/airline-themes
url = https://github.com/vim-airline/vim-airline-themes.git
[submodule "pack/plugin/opt/ultisnips"]
path = pack/plugin/opt/ultisnips
url = https://github.com/SirVer/ultisnips.git
[submodule "pack/snippets/opt/snippets"]
path = pack/snippets/opt/snippets
url = https://github.com/honza/vim-snippets.git

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 wunewww
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,5 +1,22 @@
# Vim Configuration
# simvim
This is my vim(neovim) configuration, mainly using Lazy.vim as Configuration
manager and adding some basic support so that it can be used in multi-purpose
tasks.
This is wuniu's vim profiles which is simple and like to vim original
experience.
Note below describes some interesting tricks.
## Load Sequence
1. vimrc and scripts are triggered by vimrc
1. plugins under `plugins/` and scripts triggered by them
1. packs under `pack/plugin/start/` and etc.
## Generate Doc
After installing / adding a new pack with `doc/` inside. Generate doc tags
using `packloadall | silent! helptags ALL`, which will regenerate all tags of docs.
## Reloading `vimrc` File
After editing vimrc file, one can execute it by `:so $MYVIMRC`. But this will
only *execute* it but won't reload vim instance itself.

View File

@ -1,38 +0,0 @@
let mapleader = "\\"
set autoindent
set expandtab
set softtabstop =4
set shiftwidth =4
set shiftround
set backspace =indent,eol,start
set hidden
set laststatus =2
set display =lastline
set showmode
set showcmd
set incsearch
set hlsearch
set ttyfast
set lazyredraw
set list
" if &shell =~# 'fish$'
" set shell=/bin/zsh
" endif
set noeb
set vb t_vb=
set foldmethod =marker
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
lua << EOF
require("config.lazy")
EOF

View File

@ -1,35 +0,0 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = "\\"
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "catppuccin-mocha" } },
-- automatically check for plugin updates
checker = { enabled = true },
})

View File

@ -1,34 +0,0 @@
return {
{
"dense-analysis/ale",
event = { "BufReadPost", "BufNewFile" }, -- 延迟加载
init = function()
-- 禁用 ALE 补全(不再需要)
vim.g.ale_completion_enabled = 0
-- 全局 Fixers
vim.g.ale_fixers = {
['*'] = { 'remove_trailing_lines', 'trim_whitespace' },
}
-- 保存时自动修复
vim.g.ale_fix_on_save = 1
-- 浮动窗口样式Neovim 专属)
vim.g.ale_floating_preview = 1
vim.g.ale_floating_window_border = { '', '', '', '', '', '', '', '' }
vim.g.ale_hover_to_floating_preview = 1
end,
keys = {
-- 错误导航
{ "<C-k>", "<Plug>(ale_previous_wrap)", mode = "n", desc = "ALE Previous Error" },
{ "<C-j>", "<Plug>(ale_next_wrap)", mode = "n", desc = "ALE Next Error" },
-- 功能键位
{ "gh", "<Plug>(ale_hover)", mode = "n", desc = "ALE Hover" },
{ "<leader>d", "<Plug>(ale_detail)", mode = "n", desc = "ALE Detail" },
{ "<leader>x", "<Plug>(ale_fix)", mode = "n", desc = "ALE Fix" },
{ "<leader>g", "<Plug>(ale_go_to_definition_in_tab)", mode = "n", desc = "ALE Go to Definition (Tab)" },
{ "<leader>r", "<Plug>(ale_find_references)", mode = "n", desc = "ALE Find References" },
},
}
}

View File

@ -1,6 +0,0 @@
-- 用于括号、引号和格式化补全
return {
"tpope/vim-endwise",
"jiangmiao/auto-pairs",
}

View File

@ -1,35 +0,0 @@
-- buffer tabs
--
return {
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
opts = {
options = {
mode = "buffers",
separator_style = "slant",
diagnostics = "nvim_lsp",
sort_by = "extension",
offsets = {
{
filetype = "nerdtree",
text = "File Explorer",
highlight = "Directory",
separator = true,
},
},
hover = {
enabled = true,
delay = 200,
reveal = { "close" },
},
},
},
keys = {
{ "<Tab>", "<Cmd>BufferLineCycleNext<CR>", desc = "Next Buffer" },
{ "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>", desc = "Previous Buffer" },
{ "<leader>bd", "<Cmd>BufferLinePickClose<CR>", desc = "Close Buffer" },
},
}
}

View File

@ -1,12 +0,0 @@
-- 配色方案
--
return {
{ "catppuccin/nvim",
name = "catppuccin",
lazy = false,
priority = 1000,
config = function()
vim.cmd([[colorscheme catppuccin-frappe]])
end,
},
}

View File

@ -1,96 +0,0 @@
-- complete-functions etc
-- and snippets
--
return {
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp"
},
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-buffer", -- 缓冲区补全
"hrsh7th/cmp-path", -- 文件路径补全
"hrsh7th/cmp-cmdline", -- 命令行补全
"saadparwaiz1/cmp_luasnip", -- LuaSnip 集成
"L3MON4D3/LuaSnip", -- 代码片段引擎
"rafamadriz/friendly-snippets", -- 预定义片段库
"onsails/lspkind.nvim", -- 美化补全菜单图标
},
event = "InsertEnter", -- 插入模式时加载
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- 加载友好代码片段库
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- 启用 LuaSnip
end,
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-n>"] = cmp.mapping.complete(), -- 触发补全
["<C-e>"] = cmp.mapping.abort(), -- 关闭补全
['<CR>'] = cmp.mapping(function(fallback)
if cmp.visible() then
if luasnip.expandable() then
luasnip.expand()
else
cmp.confirm({
select = true,
})
end
else
fallback()
end
end),
-- 超级Tab (片段跳转支持)
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "luasnip" }, -- LuaSnip 片段
{ name = "nvim_lsp" }, -- LSP 补全
{ name = "path" }, -- 文件路径
{ name = "buffer" }, -- 缓冲区内容
}),
completion = {
autocomplete = false,
}
})
-- 命令行补全
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "cmdline" },
}),
})
end,
},
}

View File

@ -1,12 +0,0 @@
-- git support stuff
--
return {
{
"tpope/vim-fugitive",
cmd = {
"G",
"Git",
"Gedit", "Gdiffsplit", "Gread", "Gwrite", "GMove", "Ggrep", "GDelete", "GBrowse"
}
},
}

View File

@ -1,20 +0,0 @@
-- Some help functions
--
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}

View File

@ -1,27 +0,0 @@
-- some addtional mode like zen mode
--
return {
{
"folke/zen-mode.nvim",
opts = {
window = {
width = 80,
height = 0.8,
options = {
signcolumn = "no",
}
},
on_open = function()
vim.g.zen_original_background = vim.o.background -- 保存当前背景
vim.o.background = "light" -- 强制改为 light
vim.cmd("colorscheme " .. vim.g.colors_name) -- 重新应用当前主题(确保背景生效)
end,
on_close = function()
if vim.g.zen_original_background then
vim.o.background = vim.g.zen_original_background -- 恢复背景
vim.cmd("colorscheme " .. vim.g.colors_name) -- 重新应用主题
end
end,
},
}
}

View File

@ -1,61 +0,0 @@
-- 用于搜索和快速移动
--
return {
{
"preservim/nerdtree",
keys = {
{ "<leader>n", ":NERDTreeFocus<CR>", mode = "n", desc = "Nerd Tree Focus" },
{ "<C-n>", ":NERDTree<CR>", mode = "n", desc = "Nerd Tree" },
{ "<C-t>", ":NERDTreeToggle<CR>", mode = "n", desc = "Nerd Tree Toggle" },
{ "<C-s>", ":NERDTreeFind<CR>", mode = "n", desc = "Nerd Tree Find" },
},
},
{
'nvim-telescope/telescope.nvim', branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim', "nvim-tree/nvim-web-devicons", "nvim-telescope/telescope-file-browser.nvim" },
opts = {
defaults = {
file_ignore_patterns = { "node_modules", ".git" },
layout_strategy = "vertical",
},
pickers = {
find_files = {
hidden = true,
}
}
},
keys = {
{ "<leader>tf", "<cmd>lua require('telescope.builtin').find_files()<cr>", desc = "Find Files" },
{ "<leader>tg", "<cmd>lua require('telescope.builtin').live_grep()<cr>", desc = "Live Grep" },
{ "<leader>tb", "<cmd>lua require('telescope.builtin').buffers()<cr>", desc = "Find Buffers" },
{ "<leader>th", "<cmd>lua require('telescope.builtin').help_tags()<cr>", desc = "Help Tags" },
{ "gf", "<cmd>Telescope file_browser path=%:p:h<cr>", desc = "Open File Under Cursor" },
}
},
{
"easymotion/vim-easymotion",
keys = { -- 所有键位都通过 lazy.nvim 的 keys 字段定义
-- <Leader>f{char} 跳转到字符(跨窗口)
{ "<leader>f", "<Plug>(easymotion-overwin-f)", mode = "n", desc = "EasyMotion 跳转字符" },
{ "<leader>f", "<Plug>(easymotion-bd-f)", mode = { "x", "o" }, desc = "EasyMotion 跳转字符(可视模式)" },
-- s{char}{char} 跳转到双字符
{ "s", "<Plug>(easymotion-overwin-f2)", mode = "n", desc = "EasyMotion 跳转双字符" },
-- <Leader>L 跳转行(上下)
{ "<leader>l", "<Plug>(easymotion-overwin-line)", mode = "n", desc = "EasyMotion 跳转行" },
{ "<leader>l", "<Plug>(easymotion-bd-jk)", mode = { "x", "o" }, desc = "EasyMotion 跳转行(可视模式)" },
-- <Leader>w 跳转单词
{ "<leader>w", "<Plug>(easymotion-overwin-w)", mode = "n", desc = "EasyMotion 跳转单词" },
{ "<leader>w", "<Plug>(easymotion-bd-w)", mode = { "x", "o" }, desc = "EasyMotion 跳转单词(可视模式)" },
},
init = function()
-- 基础配置
vim.g.EasyMotion_do_mapping = 0 -- 禁用默认映射
vim.g.EasyMotion_smartcase = 1 -- 智能大小写
vim.g.EasyMotion_keys = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -- 跳转标签
end,
}
}

View File

@ -1,11 +0,0 @@
-- statusline
return {
'nvim-lualine/lualine.nvim',
opts = {
options = {
theme = 'auto',
icons_enabled = true,
},
},
}

@ -0,0 +1 @@
Subproject commit be4725cfc3fb6ed96f706d9d1bd5baa24d2b048c

@ -0,0 +1 @@
Subproject commit d9a7650e76c85f8ba437e056d08dd43b01b8bfd6

@ -0,0 +1 @@
Subproject commit 83982349e45e6d27d186ad82050f86c3233a16f0

@ -0,0 +1 @@
Subproject commit ff0f9a45a5d81d2c8aa67601c264b18c4fe26b15

@ -0,0 +1 @@
Subproject commit a9aa25ce323b2dd04a52706f4d1b044f4feb7617

@ -0,0 +1 @@
Subproject commit f3a4d8eaa8ac10305e3d53851c976756ea9dc8e8

@ -0,0 +1 @@
Subproject commit 49dc8cb2086db19d385791c8e1635723b0fd95c7

@ -0,0 +1 @@
Subproject commit b3cfab2a6302b3b39f53d9fd2cd997e1127d7878

1
pack/plugin/start/ale Submodule

@ -0,0 +1 @@
Subproject commit 70eeae54fbd5c2e254604d543674f02d42c0ccdd

@ -0,0 +1 @@
Subproject commit 24afe922e6a05891756ecf331f39a1f6743d3d5a

@ -0,0 +1 @@
Subproject commit 5a36fd29df63ea3f65562bd2bb837be48a5ec90b

@ -0,0 +1 @@
Subproject commit aad1e8fa31cb4722f20fe40679caa56e25120032

@ -0,0 +1 @@
Subproject commit c4b8f52cbb7142ec239494e5a2c4a512f92c4d07

@ -0,0 +1 @@
Subproject commit ce882460cf3db12e99f8bf579cbf99e331f6dd4f

@ -0,0 +1 @@
Subproject commit 3d188ed2113431cf8dac77be61b842acb64433d9

@ -0,0 +1 @@
Subproject commit 393d980157b8149b3ff65a48bc4aae24dca9c846

13
vimrc Normal file
View File

@ -0,0 +1,13 @@
" This is vimrc file, using as the profile of vim.
" After modify vimrc, use `:so $MYVIMRC` to reload new profile.
" Settings could be rewrited by editing this file.
" Basic settings
runtime! vimrc.d/0*.vim
" Settings related to packages
runtime! vimrc.d/30-Easymotion.vim
runtime! vimrc.d/31-NerdTree.vim
runtime! vimrc.d/32-ale.vim
" runtime! vimrc.d/33-airline.vim " This will cause startup delay.
runtime! vimrc.d/34-ultisnips.vim

91
vimrc.d/01-basic.vim Normal file
View File

@ -0,0 +1,91 @@
" This is vimrc basic settings.
" Settings could be overwrited by modifying ../vimrc
" env variables
if has('win32') || has('win64')
let g:CONFIGPATH = $USERPROFILE . '/vimfiles'
elseif has('unix')
let g:CONFIGPATH = $HOME . '/.vim'
endif
filetype plugin indent on " Load plugins according to detected filetype.
syntax on " Enable syntax highlighting.
set autoindent " Indent according to previous line.
set expandtab " Use spaces instead of tabs.
set softtabstop =4 " Tab key indents by 4 spaces.
set shiftwidth =4 " >> indents by 4 spaces.
set shiftround " >> indents to next multiple of 'shiftwidth'.
set backspace =indent,eol,start " Make backspace work as you would expect.
set hidden " Switch between buffers without having to save first.
set laststatus =2 " Always show statusline.
set display =lastline " Show as much as possible of the last line.
set showmode " Show current mode in command-line.
set showcmd " Show already typed keys when more are expected.
set incsearch " Highlight while searching with / or ?.
set hlsearch " Keep matches highlighted.
set ttyfast " Faster redrawing.
set lazyredraw " Only redraw when necessary.
set splitbelow " Open new windows below the current window.
set splitright " Open new windows right of the current window.
set cursorline " Find the current line quickly.
set wrapscan " Searches wrap around end-of-file.
set report =0 " Always report changed lines.
set synmaxcol =200 " Only highlight the first 200 columns.
set list " Show non-printable characters.
if has('multi_byte') && &encoding ==# 'utf-8'
let &listchars = 'tab:▸ ,extends:,precedes:,nbsp:±'
else
let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.'
endif
" The fish shell is not very compatible to other shells and unexpectedly
" breaks things that use 'shell'.
if &shell =~# 'fish$'
set shell=/bin/bash
endif
if has('win32')
" set shell=pwsh.exe
" set shellcmdflag=-nop\ -c
endif
" Put all temporary files under the same directory.
" https://github.com/mhinz/vim-galore#temporary-files
set backup
set backupext =-vimbackup
set backupskip =
set updatecount =100
set undofile
if exists('g:CONFIGPATH')
execute 'set undodir=' . escape(g:CONFIGPATH, ' \') . '/undo/'
execute 'set directory=' . escape(g:CONFIGPATH, ' \') . '/swap/'
execute 'set backupdir=' . escape(g:CONFIGPATH, ' \') . '/backup/'
endif
" set textwidth =80
set updatetime =300
set signcolumn =yes
set smartcase
set foldmethod =manual
" Turn off beep & alert bell
set noeb
set vb t_vb=
" Colorscheme when lauching in Windows Terminal
" which has strange redering scheme
if has('win32') || has('win64')
colorscheme desert
endif

16
vimrc.d/02-gui.vim Normal file
View File

@ -0,0 +1,16 @@
" This is special settings for vim-gui.
"
if has("gui_running")
if has("gui_macvim")
set guifont=Menlo\ Regular:h14
elseif has("gui_win32")
set guifont=CaskaydiaMono\ NFM:h12
else
set guifont=Inconsolata\ Nerd\ Font\ 12
endif
set go-=T
set go-=m
set go-=r
set go-=L
colorscheme catppuccin_mocha
endif

3
vimrc.d/03-remaps.vim Normal file
View File

@ -0,0 +1,3 @@
" Remaps which are not related to packages
nnoremap <C-n> :nohlsearch<CR>

41
vimrc.d/30-Easymotion.vim Normal file
View File

@ -0,0 +1,41 @@
" This is customized file for easymotion package.
packadd! vim-easymotion
let g:EasyNotion_do_mapping = 0 " Disable default mapping
map <Leader> <Plug>(easymotion-prefix)
" <Leader>f{char} to move to {char}
map <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
nmap s <Plug>(easymotion-overwin-f2)
" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
" Gif config
nmap s <Plug>(easymotion-s2)
nmap t <Plug>(easymotion-t2)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
" These `n` & `N` mappings are options. You do not have to map `n` & `N` to EasyMotion.
" Without these mappings, `n` & `N` works fine. (These mappings just provide
" different highlight method and have some other features )
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
" Gif config
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
let g:Easymotion_smartcase = 1

3
vimrc.d/31-NerdTree.vim Normal file
View File

@ -0,0 +1,3 @@
" This is configurations for NerdTree
packadd! nerdtree
nnoremap <leader>n :NERDTreeFocus<CR>

31
vimrc.d/32-ale.vim Normal file
View File

@ -0,0 +1,31 @@
" Enable completion where available.
" This setting must be set before ALE is loaded.
"
" You should not turn this setting on if you wish to use ALE as a completion
" source for other completion plugins, like Deoplete.
packadd! ale
" Enable ale completion
let g:ale_completion_enabled = 1
set omnifunc=ale#completion#OmniFunc
" Enable some ale fixers globally
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\}
" fix when save
let g:ale_fix_on_save=1
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
nmap gh <Plug>(ale_hover)
nmap <leader>d <Plug>(ale_detail)
nmap <leader>x <Plug>(ale_fix)
nmap <leader>g <Plug>(ale_go_to_definition_in_tab)
nmap <leader>r <Plug>(ale_find_references)
let g:ale_floating_preview=1
let g:ale_floating_window_border=['│', '─', '╭', '╮', '╯', '╰', '│', '─']
let g:ale_hover_to_floating_preview=1

43
vimrc.d/33-airline.vim Normal file
View File

@ -0,0 +1,43 @@
" This is configurations for airline.
packadd! airline
packadd! airline-themes
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.colnr = ' ㏇:'
let g:airline_symbols.colnr = ' ℅:'
let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.linenr = '☰'
let g:airline_symbols.linenr = ' ␊:'
let g:airline_symbols.linenr = ' ␤:'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.maxlinenr = '㏑'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.spell = 'Ꞩ'
let g:airline_symbols.notexists = 'Ɇ'
let g:airline_symbols.notexists = '∄'
let g:airline_symbols.whitespace = 'Ξ'
" powerline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.colnr = ' ℅:'
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ' :'
let g:airline_symbols.maxlinenr = '☰ '
let g:airline_symbols.dirty='⚡'

19
vimrc.d/34-ultisnips.vim Normal file
View File

@ -0,0 +1,19 @@
" Ultisnips configurations
packadd! ultisnips
" Uncomment if want some default snippets
packadd! snippets
" Trigger configuration. You need to change this to something other than <tab>
" if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" Snippets directories
let g:UltiSnipsSnippetDirectories=["snips", "UltiSnips"]
let g:UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit=g:CONFIGPATH . "/snips"