vim: move plugin configurations to after/plugin/*.lua
This commit is contained in:
parent
445e6c4a9d
commit
08a5953fc6
11 changed files with 90 additions and 45 deletions
4
nvim/.config/nvim/after/plugin/ctrlp.lua
Normal file
4
nvim/.config/nvim/after/plugin/ctrlp.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
vim.g.ctrlp_match_window = 'bottom,order:ttb'
|
||||
vim.g.ctrlp_switch_buffer = 0 -- open files in new buffer
|
||||
vim.g.ctrlp_show_hidden = 1 -- show hidden files
|
||||
|
6
nvim/.config/nvim/after/plugin/nerdtree.lua
Normal file
6
nvim/.config/nvim/after/plugin/nerdtree.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
local nmap = require'fs.keymap'.nmap
|
||||
|
||||
-- toggle NERDTree
|
||||
nmap { '<leader>n', '<cmd>NERDTreeToggle<cr>' }
|
||||
|
||||
|
7
nvim/.config/nvim/after/plugin/rainbow_parentheses.lua
Normal file
7
nvim/.config/nvim/after/plugin/rainbow_parentheses.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
vim.g['rainbow#pairs'] = { {'(',')'}, {'[',']'}, {'{','}'} }
|
||||
|
||||
local nmap = require'fs.keymap'.nmap
|
||||
|
||||
-- toggle rainbow parens
|
||||
nmap { '<leader>p', '<cmd>RainbowParentheses!!<cr>' }
|
||||
|
10
nvim/.config/nvim/after/plugin/srec.lua
Normal file
10
nvim/.config/nvim/after/plugin/srec.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
vim.cmd([[
|
||||
highlight link srecStart Comment
|
||||
highlight link srecType Comment
|
||||
highlight link srecLength WarningMsg
|
||||
highlight link srec16BitAddress Constant
|
||||
highlight link srec24BitAddress Constant
|
||||
highlight link srec32BitAddress Constant
|
||||
highlight link srecChecksum Type
|
||||
]])
|
||||
|
6
nvim/.config/nvim/after/plugin/vim-fugitive.lua
Normal file
6
nvim/.config/nvim/after/plugin/vim-fugitive.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
local nmap = require'fs.keymap'.nmap
|
||||
|
||||
-- use fugitive
|
||||
nmap { '<leader>gg', '<cmd>G<cr>' }
|
||||
nmap { '<leader>g<space>', '<cmd>G ' }
|
||||
|
11
nvim/.config/nvim/after/plugin/vim-json.lua
Normal file
11
nvim/.config/nvim/after/plugin/vim-json.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
-- Disable quote concealling.
|
||||
vim.g.vim_json_syntax_conceal = 0
|
||||
|
||||
-- Make numbers and booleans stand out.
|
||||
vim.cmd([[
|
||||
highlight link jsonBraces Text
|
||||
highlight link jsonNumber Identifier
|
||||
highlight link jsonBoolean Identifier
|
||||
highlight link jsonNull Identifier
|
||||
]])
|
||||
|
15
nvim/.config/nvim/after/plugin/vim-markdown.lua
Normal file
15
nvim/.config/nvim/after/plugin/vim-markdown.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
-- Disable concealling on italic, bold, etc.
|
||||
vim.g.vim_markdown_conceal = 0
|
||||
|
||||
-- Disable concealling on code blocks.
|
||||
vim.g.vim_markdown_conceal_code_blocks = 0
|
||||
|
||||
-- Automatic insertion of bullets is buggy. so disable it.
|
||||
vim.g.vim_markdown_auto_insert_bullets = 0
|
||||
vim.g.vim_markdown_new_list_item_indent = 0
|
||||
|
||||
local nmap = require'fs.keymap'.buffer_nmap
|
||||
nmap { '<leader>+', '<cmd>.,.HeaderIncrease<cr>' }
|
||||
nmap { '<leader>=', '<cmd>.,.HeaderIncrease<cr>' }
|
||||
nmap { '<leader>-', '<cmd>.,.HeaderDecrease<cr>' }
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
local nmap = require'fs.keymap'.nmap
|
||||
|
||||
-- fix whitespace
|
||||
nmap { '<leader>w', '<cmd>FixWhitespace<cr>' }
|
||||
|
24
nvim/.config/nvim/lua/fs/keymap.lua
Normal file
24
nvim/.config/nvim/lua/fs/keymap.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
local M = {}
|
||||
|
||||
local extend = function(opts)
|
||||
return vim.tbl_extend('keep', opts or {}, { noremap = true })
|
||||
end
|
||||
|
||||
M.nmap = function(tbl)
|
||||
vim.api.nvim_set_keymap('n', tbl[1], tbl[2], extend(tbl[3]))
|
||||
end
|
||||
|
||||
M.imap = function(tbl)
|
||||
vim.api.nvim_set_keymap('n', tbl[1], tbl[2], extend(tbl[3]))
|
||||
end
|
||||
|
||||
M.buffer_nmap = function(tbl)
|
||||
vim.api.nvim_buf_set_keymap(0, 'n', tbl[1], tbl[2], extend(tbl[3]))
|
||||
end
|
||||
|
||||
M.buffer_imap = function(tbl)
|
||||
vim.api.nvim_buf_set_keymap(0, 'i', tbl[1], tbl[2], extend(tbl[3]))
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -62,22 +62,9 @@ register {
|
|||
-- quickly change background
|
||||
M('n', '<leader>bg', [[:let &background = &background ==? 'light' ? 'dark' : 'light'<cr>]]),
|
||||
|
||||
-- use fugitive
|
||||
M('n', '<leader>gg', ':G<cr>'),
|
||||
M('n', '<leader>g<space>', ':G '),
|
||||
|
||||
-- disable highlight until next search
|
||||
M('n', '<leader>h', ':nohlsearch<cr>'),
|
||||
|
||||
-- toggle NERDTree
|
||||
M('n', '<leader>n', ':NERDTreeToggle<cr>'),
|
||||
|
||||
-- toggle rainbow parens
|
||||
M('n', '<leader>p', ':RainbowParentheses!!<cr>'),
|
||||
|
||||
-- edit init.lua
|
||||
M('n', '<leader>v', ':e $MYVIMRC<cr>'),
|
||||
|
||||
-- fix whitespace
|
||||
M('n', '<leader>w', ':FixWhitespace<cr>'),
|
||||
}
|
||||
|
|
|
@ -1,62 +1,32 @@
|
|||
local g = vim.g
|
||||
|
||||
local plugins = function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- Visuals ----------------------------------------------------------------
|
||||
|
||||
use 'altercation/vim-colors-solarized'
|
||||
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
|
||||
}
|
||||
|
||||
-- Navigation -------------------------------------------------------------
|
||||
use { 'scrooloose/nerdtree', cmd = 'NERDTreeToggle' }
|
||||
use 'junegunn/rainbow_parentheses.vim'
|
||||
vim.g['rainbow#pairs'] = { {'(',')'}, {'[',']'}, {'{','}'} }
|
||||
use 'ctrlpvim/ctrlp.vim'
|
||||
g.ctrlp_match_window = 'bottom,order:ttb'
|
||||
g.ctrlp_switch_buffer = 0 -- open files in new buffer
|
||||
g.ctrlp_show_hidden = 1 -- show hidden files
|
||||
|
||||
|
||||
-- Editing ----------------------------------------------------------------
|
||||
|
||||
use 'bronson/vim-trailing-whitespace'
|
||||
use 'godlygeek/tabular'
|
||||
use 'tpope/vim-commentary'
|
||||
|
||||
-- git ----------------------------------------------------------------
|
||||
-- git --------------------------------------------------------------------
|
||||
use 'tpope/vim-fugitive'
|
||||
|
||||
-- Filetypes --------------------------------------------------------------
|
||||
|
||||
use 'elzr/vim-json'
|
||||
-- Disable quote concealling.
|
||||
g.vim_json_syntax_conceal = 0
|
||||
-- Make numbers and booleans stand out.
|
||||
vim.cmd([[
|
||||
highlight link jsonBraces Text
|
||||
highlight link jsonNumber Identifier
|
||||
highlight link jsonBoolean Identifier
|
||||
highlight link jsonNull Identifier
|
||||
]])
|
||||
use 'plasticboy/vim-markdown'
|
||||
g.vim_markdown_conceal_code_blocks = 0
|
||||
use 'keith/swift.vim'
|
||||
use 'chr4/nginx.vim'
|
||||
use 'vim-scripts/srec.vim'
|
||||
vim.cmd([[
|
||||
highlight link srecStart Comment
|
||||
highlight link srecType Comment
|
||||
highlight link srecLength WarningMsg
|
||||
highlight link srec16BitAddress Constant
|
||||
highlight link srec24BitAddress Constant
|
||||
highlight link srec32BitAddress Constant
|
||||
highlight link srecChecksum Type
|
||||
]])
|
||||
|
||||
|
||||
vim.cmd([[
|
||||
silent! colorscheme solarized
|
||||
|
|
Loading…
Add table
Reference in a new issue