vim: create a main setup function
This commit is contained in:
parent
cf4c53541f
commit
546db023f4
18 changed files with 358 additions and 408 deletions
|
@ -1,13 +1,2 @@
|
||||||
vim.g.mapleader = ' '
|
require('fschauen').setup()
|
||||||
vim.g.maplocalleader = ','
|
|
||||||
|
|
||||||
require 'fschauen.setup.globals'
|
|
||||||
require 'fschauen.setup.options'
|
|
||||||
require('fschauen.keymap').setup()
|
|
||||||
require 'fschauen.setup.autocmd'
|
|
||||||
require 'fschauen.setup.filetype'
|
|
||||||
require 'fschauen.setup.diagnostic'
|
|
||||||
require 'fschauen.setup.lazy'
|
|
||||||
|
|
||||||
require('fschauen').colorscheme('gruvbox')
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
M = {}
|
local M = {}
|
||||||
|
|
||||||
local diag_opts = {
|
local diag_opts = {
|
||||||
wrap = false, -- don't wrap around the begin/end of file
|
wrap = false, -- don't wrap around the begin/end of file
|
||||||
|
@ -41,5 +41,32 @@ M.hide = function(bufnr)
|
||||||
vim.diagnostic.hide(nil, bufnr or 0)
|
vim.diagnostic.hide(nil, bufnr or 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---Customize nvim's diagnostics display.
|
||||||
|
M.setup = function()
|
||||||
|
vim.diagnostic.config {
|
||||||
|
underline = false,
|
||||||
|
virtual_text = {
|
||||||
|
spacing = 6,
|
||||||
|
prefix = '●',
|
||||||
|
},
|
||||||
|
float = {
|
||||||
|
border = 'rounded',
|
||||||
|
},
|
||||||
|
severity_sort = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
local signs = {
|
||||||
|
Error = ' ',
|
||||||
|
Warn = ' ',
|
||||||
|
Info = ' ',
|
||||||
|
Hint = ' ',
|
||||||
|
}
|
||||||
|
|
||||||
|
for type, icon in pairs(signs) do
|
||||||
|
local hl = 'DiagnosticSign' .. type
|
||||||
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
||||||
|
|
|
@ -1,53 +1,232 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
--- Flip function arguments.
|
P = function(v)
|
||||||
---
|
print(vim.inspect(v))
|
||||||
--- flip(f)(a, b) == f(b, a)
|
return v
|
||||||
---
|
|
||||||
---@param f function: function to flip.
|
|
||||||
---@return function: function that takes `f`'s arguments flipped.
|
|
||||||
M.flip = function(f)
|
|
||||||
return function(a, b)
|
|
||||||
return f(b, a)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Concatenate lists.
|
R = function(module)
|
||||||
---
|
require('plenary.reload').reload_module(module)
|
||||||
--- extend({'a', 'b'}, {'c', 'd'}) == {'a', 'b', 'c', 'd'}
|
return require(module)
|
||||||
--- extend({1, 2}, {3, 4}, {5, 6}) == {1, 2, 3, 4, 5, 6}
|
|
||||||
---
|
|
||||||
---@param ... table: lists to concatenate.
|
|
||||||
---@return table: concatenation of arguments.
|
|
||||||
M.concat = function(...)
|
|
||||||
local result = {}
|
|
||||||
for _, tbl in ipairs {...} do
|
|
||||||
for _, v in pairs(tbl) do
|
|
||||||
result[#result+1] = v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return result
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Partial function application.
|
local set_options = function()
|
||||||
---
|
vim.g.mapleader = ' '
|
||||||
--- partial(f, x)(...) == f(x, ...)
|
vim.g.maplocalleader = ','
|
||||||
--- partial(f, x, y)(...) == f(x, y, ...)
|
|
||||||
---
|
vim.cmd [[let &t_8f = "\<ESC>[38:2:%lu:%lu:%lum"]]
|
||||||
---@param f function: function to partially apply.
|
vim.cmd [[let &t_8b = "\<ESC>[48:2:%lu:%lu:%lum"]]
|
||||||
---@param ... any: arguments to bind.
|
|
||||||
---@return function: partially applied function.
|
local o = vim.opt
|
||||||
M.partial = function(f, ...)
|
|
||||||
local argv = {...}
|
-- General
|
||||||
return function(...)
|
o.belloff = 'all' -- never ring bells
|
||||||
return f(unpack(M.concat(argv, {...})))
|
o.hidden = true -- hide abandoned buffers
|
||||||
end
|
o.clipboard = 'unnamedplus' -- synchronize with system clipboard
|
||||||
|
o.lazyredraw = true -- don't redraw screen during macros
|
||||||
|
o.modelines = 0 -- never use modelines
|
||||||
|
o.fileformats = 'unix,mac,dos' -- prioritize unix <EOL> format
|
||||||
|
o.pastetoggle = '<F20>' -- toggle paste with P on Moonlander
|
||||||
|
|
||||||
|
o.swapfile = false -- don't use swap files
|
||||||
|
o.writebackup = true -- Make a backup before writing a file...
|
||||||
|
o.backup = false -- ...but don't keep it around.
|
||||||
|
o.undofile = true -- write undo history
|
||||||
|
|
||||||
|
o.shortmess:append 'I' -- no intro message when starting Vim
|
||||||
|
o.shada = {
|
||||||
|
"'1000", -- remember marks for this many files
|
||||||
|
"/1000", -- remember this many search patterns
|
||||||
|
":1000", -- remember this many command line items
|
||||||
|
"<100", -- maximum number of lines to remember per register
|
||||||
|
"h", -- disable 'hlsearch' while reading shada file
|
||||||
|
"s100", -- limit size of remembered items to this many KiB
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Searching
|
||||||
|
o.ignorecase = true -- Ignore case when searching...
|
||||||
|
o.smartcase = true -- ...unless pattern contains uppercase characters.
|
||||||
|
o.wrapscan = false -- Don't wrap around the end of the file when searching.
|
||||||
|
|
||||||
|
-- Editing
|
||||||
|
o.expandtab = true -- use spaces when <Tab> is inserted
|
||||||
|
o.tabstop = 4 -- tabs are 4 spaces
|
||||||
|
o.shiftwidth = 0 -- (auto)indent using 'tabstop' spaces
|
||||||
|
o.smartindent = true -- use smart autoindenting
|
||||||
|
o.inccommand = 'split' -- preview command partial results
|
||||||
|
o.joinspaces = false -- use one space after a period whe joining lines
|
||||||
|
o.showmatch = true -- briefly jump to matching bracket if insert one
|
||||||
|
o.virtualedit = 'block' -- position the cursor anywhere in Visual Block mode
|
||||||
|
o.formatlistpat = [[^\s*\(\d\+[\]:.)}\t ]\|[-+*]\|[\[(][ x][\])]\)\s*]]
|
||||||
|
o.completeopt = {
|
||||||
|
'menu', -- show completions in a popup menu
|
||||||
|
'preview', -- show extra information about the selected match
|
||||||
|
'noinsert', -- don't insert text until I select a match
|
||||||
|
'noselect', -- don't pre-select the first match in the menu
|
||||||
|
}
|
||||||
|
|
||||||
|
local fmt = o.formatoptions
|
||||||
|
fmt:remove 't' -- Don't auto-wrap on 'textwidth'...
|
||||||
|
fmt:append 'c' -- ...but do it within comment blocks...
|
||||||
|
fmt:append 'l' -- ...but not if line was already long before entering Insert mode.
|
||||||
|
fmt:append 'r' -- Insert comment leader when pressing Enter...
|
||||||
|
fmt:remove 'o' -- ...but not when opening a new line with o & O.
|
||||||
|
fmt:append 'q' -- allow formatting of comments with gq
|
||||||
|
fmt:remove 'a' -- don't auto-format every time text is inserted
|
||||||
|
fmt:append 'n' -- indent lists automatically acc. 'formatlistpat'
|
||||||
|
fmt:append 'j' -- remove comment leader when joining lines
|
||||||
|
fmt:append '1' -- don't break lines after a one letter word but rather before it
|
||||||
|
|
||||||
|
-- Appearance
|
||||||
|
o.termguicolors = true -- use "gui" :higlight instead of "cterm"
|
||||||
|
o.showmode = false -- don't show mode (shown in statusline instead)
|
||||||
|
o.relativenumber = true -- Start off with relative line numbers...
|
||||||
|
o.number = true -- ...but real number for current line.
|
||||||
|
o.wrap = false -- don't wrap long lines initially
|
||||||
|
o.textwidth = 80 -- maximum width for text being inserted
|
||||||
|
o.colorcolumn = '+1' -- highlight column after 'textwidth'
|
||||||
|
o.cursorline = true -- highlight the line of the cursor...
|
||||||
|
o.cursorlineopt = 'number'-- ...but only the line number
|
||||||
|
o.showbreak = '⤷ ' -- prefix for wrapped lines
|
||||||
|
o.scrolloff = 3 -- min. # of lines above and below cursor
|
||||||
|
o.sidescrolloff = 3 -- min. # of columns to left and right of cursor
|
||||||
|
o.signcolumn = 'number' -- display signs in 'number' column
|
||||||
|
o.list = false -- don't show invisible characters initially
|
||||||
|
o.listchars = {
|
||||||
|
eol = '↲',
|
||||||
|
tab = '» ',
|
||||||
|
extends = '…',
|
||||||
|
precedes = '…',
|
||||||
|
trail = '·',
|
||||||
|
conceal = '┊',
|
||||||
|
}
|
||||||
|
o.fillchars = {
|
||||||
|
diff = '⋅',
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Wildcard Expansion
|
||||||
|
o.wildignore = {
|
||||||
|
'.git',
|
||||||
|
'.svn',
|
||||||
|
'__pycache__',
|
||||||
|
'**/tmp/**',
|
||||||
|
'*.DS_Store',
|
||||||
|
'*.dll',
|
||||||
|
'*.egg-info',
|
||||||
|
'*.exe',
|
||||||
|
'*.gif',
|
||||||
|
'*.jpeg',
|
||||||
|
'*.jpg',
|
||||||
|
'*.o',
|
||||||
|
'*.obj',
|
||||||
|
'*.out',
|
||||||
|
'*.png',
|
||||||
|
'*.pyc',
|
||||||
|
'*.so',
|
||||||
|
'*.zip',
|
||||||
|
'*~',
|
||||||
|
}
|
||||||
|
o.wildignorecase = true -- ignore case when completing file names
|
||||||
|
o.wildmode = 'longest:full' -- longest common prefix first, then wildmenu
|
||||||
|
|
||||||
|
-- Window Splitting
|
||||||
|
o.splitbelow = true -- :split below current window
|
||||||
|
o.splitright = true -- :vsplit to the right of current window
|
||||||
|
o.equalalways = false -- don't resize all windows when splitting
|
||||||
|
|
||||||
|
-- Folding
|
||||||
|
o.foldenable = true -- enable folding
|
||||||
|
o.foldlevelstart = 100 -- start with all folds open
|
||||||
|
o.foldmethod = 'syntax' -- fold based on syntax by default
|
||||||
|
o.foldnestmax = 10 -- limit nested folds to 10 levels
|
||||||
|
|
||||||
|
-- Options for diff mode
|
||||||
|
o.diffopt = { -- better side-by-side diffs
|
||||||
|
'filler', -- show filler lines (so text is vertically synced)
|
||||||
|
'vertical', -- use vertical splits (files side-by-side)
|
||||||
|
'closeoff', -- disable diff mode when one window is closed
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
M.colorscheme = function(name)
|
local bootstrap_lazy = function(path)
|
||||||
vim.cmd('silent! colorscheme ' .. name)
|
if not vim.loop.fs_stat(path) then
|
||||||
|
vim.fn.system {
|
||||||
|
'git',
|
||||||
|
'clone',
|
||||||
|
'--filter=blob:none',
|
||||||
|
'--branch=stable',
|
||||||
|
'https://github.com/folke/lazy.nvim.git',
|
||||||
|
path,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(path)
|
||||||
|
return vim.F.npcall(require, 'lazy')
|
||||||
|
end
|
||||||
|
|
||||||
|
local setup_plugins = function()
|
||||||
|
local lazy = bootstrap_lazy(vim.fn.stdpath('data') .. '/lazy/lazy.nvim')
|
||||||
|
if not lazy then
|
||||||
|
vim.notify('Lazy not installed and failed to bootstrap!', vim.log.levels.WARN)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
lazy.setup {
|
||||||
|
spec = 'fschauen.plugins',
|
||||||
|
-- defaults = {
|
||||||
|
-- lazy = true,
|
||||||
|
-- },
|
||||||
|
dev = {
|
||||||
|
path = '~/Projects/nvim-plugins',
|
||||||
|
fallback = true,
|
||||||
|
},
|
||||||
|
ui = {
|
||||||
|
border = 'rounded',
|
||||||
|
title = ' Lazy ',
|
||||||
|
},
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
disabled_plugins = {
|
||||||
|
'gzip',
|
||||||
|
'matchit',
|
||||||
|
'matchparen',
|
||||||
|
'netrwPlugin',
|
||||||
|
'tarPlugin',
|
||||||
|
'tohtml',
|
||||||
|
'tutor',
|
||||||
|
'zipPlugin',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
M.setup = function()
|
||||||
|
set_options()
|
||||||
|
|
||||||
|
require('fschauen.keymap').setup()
|
||||||
|
require('fschauen.diagnostic').setup()
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
|
desc = 'Briefly highlight yanked text.',
|
||||||
|
group = vim.api.nvim_create_augroup('fschauen.yank', { clear = true } ),
|
||||||
|
pattern = '*',
|
||||||
|
callback = function(_) vim.highlight.on_yank() end
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.filetype.add {
|
||||||
|
pattern = {
|
||||||
|
['${HOME}/.ssh/config.d/.*'] = 'sshconfig',
|
||||||
|
['.*/ssh/config'] = 'sshconfig',
|
||||||
|
['.*/git/config'] = 'gitconfig',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_plugins()
|
||||||
|
|
||||||
|
local colorscheme = 'gruvbox'
|
||||||
|
vim.cmd('silent! colorscheme ' .. colorscheme)
|
||||||
if vim.v.errmsg ~= '' then
|
if vim.v.errmsg ~= '' then
|
||||||
vim.notify(string.format('Colorscheme %s not found!', name), vim.log.levels.WARN)
|
vim.notify(('Colorscheme %s not found!'):format(colorscheme), vim.log.levels.WARN)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,73 +24,73 @@ end
|
||||||
|
|
||||||
local keymap = {
|
local keymap = {
|
||||||
-- better navigation for wrapped lines
|
-- better navigation for wrapped lines
|
||||||
{ 'j', 'gj' },
|
{ 'j', 'gj' },
|
||||||
{ 'k', 'gk' },
|
{ 'k', 'gk' },
|
||||||
|
|
||||||
-- maintain cursor position when joining lines
|
-- maintain cursor position when joining lines
|
||||||
{ 'J', 'mzJ`z' },
|
{ 'J', 'mzJ`z' },
|
||||||
|
|
||||||
-- retain selection when making changes in visual mode
|
-- retain selection when making changes in visual mode
|
||||||
{ '<c-a>', '<c-a>gv', 'v' },
|
{ '<c-a>', '<c-a>gv', mode = 'v' },
|
||||||
{ '<c-x>', '<c-x>gv', 'v' },
|
{ '<c-x>', '<c-x>gv', mode = 'v' },
|
||||||
{ 'g<c-a>', 'g<c-a>gv', 'v' },
|
{ 'g<c-a>', 'g<c-a>gv', mode = 'v' },
|
||||||
{ 'g<c-x>', 'g<c-x>gv', 'v' },
|
{ 'g<c-x>', 'g<c-x>gv', mode = 'v' },
|
||||||
{ '>', '><cr>gv', 'v' },
|
{ '>', '><cr>gv', mode = 'v' },
|
||||||
{ '<', '<<cr>gv', 'v' },
|
{ '<', '<<cr>gv', mode = 'v' },
|
||||||
|
|
||||||
-- place destination of important movements in the center of the screen
|
-- place destination of important movements in the center of the screen
|
||||||
{ 'n', 'nzzzv' },
|
{ 'n', 'nzzzv' },
|
||||||
{ 'N', 'Nzzzv' },
|
{ 'N', 'Nzzzv' },
|
||||||
{ '<c-d>', '<c-d>zzzv' },
|
{ '<c-d>', '<c-d>zzzv' },
|
||||||
{ '<c-u>', '<c-u>zzzv' },
|
{ '<c-u>', '<c-u>zzzv' },
|
||||||
|
|
||||||
-- easier window navigation
|
-- easier window navigation
|
||||||
{ '<c-j>', '<c-w>j' },
|
{ '<c-j>', '<c-w>j' },
|
||||||
{ '<c-k>', '<c-w>k' },
|
{ '<c-k>', '<c-w>k' },
|
||||||
{ '<c-h>', '<c-w>h' },
|
{ '<c-h>', '<c-w>h' },
|
||||||
{ '<c-l>', '<c-w>l' },
|
{ '<c-l>', '<c-w>l' },
|
||||||
|
|
||||||
-- window resizing
|
-- window resizing
|
||||||
{ '<s-Up>', window.resize_up(2), desc = 'Resize window upward' },
|
{ '<s-Up>', window.resize_up(2), desc = 'Resize window upward' },
|
||||||
{ '<s-Down>', window.resize_down(2), desc = 'Resize window downward' },
|
{ '<s-Down>', window.resize_down(2), desc = 'Resize window downward' },
|
||||||
{ '<s-Left>', window.resize_left(2), desc = 'Resize window leftward' },
|
{ '<s-Left>', window.resize_left(2), desc = 'Resize window leftward' },
|
||||||
{ '<s-Right>', window.resize_right(2), desc = 'Resize window rightward' },
|
{ '<s-Right>', window.resize_right(2), desc = 'Resize window rightward' },
|
||||||
|
|
||||||
-- easy tab navigation
|
-- easy tab navigation
|
||||||
{ '<Right>', '<cmd>tabnext<cr>' },
|
{ '<Right>', '<cmd>tabnext<cr>' },
|
||||||
{ '<Left>', '<cmd>tabprevious<cr>' },
|
{ '<Left>', '<cmd>tabprevious<cr>' },
|
||||||
|
|
||||||
-- move lines up and down
|
-- move lines up and down
|
||||||
{ '<c-a-j>', [[:move .+1<cr>==]] },
|
{ '<c-a-j>', [[:move .+1<cr>==]] },
|
||||||
{ '<c-a-k>', [[:move .-2<cr>==]] },
|
{ '<c-a-k>', [[:move .-2<cr>==]] },
|
||||||
{ '<c-a-j>', [[:move '>+1<cr>gv=gv]], 'v' },
|
{ '<c-a-j>', [[:move '>+1<cr>gv=gv]], mode = 'v' },
|
||||||
{ '<c-a-k>', [[:move '<-2<cr>gv=gv]], 'v' },
|
{ '<c-a-k>', [[:move '<-2<cr>gv=gv]], mode = 'v' },
|
||||||
{ '<c-a-j>', [[<esc>:move .+1<cr>==gi]], 'i' },
|
{ '<c-a-j>', [[<esc>:move .+1<cr>==gi]], mode = 'i' },
|
||||||
{ '<c-a-k>', [[<esc>:move .-2<cr>==gi]], 'i' },
|
{ '<c-a-k>', [[<esc>:move .-2<cr>==gi]], mode = 'i' },
|
||||||
|
|
||||||
-- move to begin/end of line in insert mode
|
-- move to begin/end of line in insert mode
|
||||||
{ '<c-a>', '<c-o>^', 'i' },
|
{ '<c-a>', '<c-o>^', mode = 'i' },
|
||||||
{ '<c-e>', '<c-o>$', 'i' },
|
{ '<c-e>', '<c-o>$', mode = 'i' },
|
||||||
|
|
||||||
-- move to begin of line in command mode (<c-e> moves to end by default)
|
-- move to begin of line in command mode (<c-e> moves to end by default)
|
||||||
{ '<c-a>', '<c-b>', 'c' },
|
{ '<c-a>', '<c-b>', mode = 'c' },
|
||||||
|
|
||||||
-- more convenient way of entering normal mode from terminal mode
|
-- more convenient way of entering normal mode from terminal mode
|
||||||
{ [[<c-\><c-\>]], [[<c-\><c-n>]], 't' },
|
{ [[<c-\><c-\>]], [[<c-\><c-n>]], mode = 't' },
|
||||||
|
|
||||||
-- recall older/recent command-line from history
|
-- recall older/recent command-line from history
|
||||||
{ '<c-j>', '<down>', 'c' },
|
{ '<c-j>', '<down>', mode = 'c' },
|
||||||
{ '<c-k>', '<up>', 'c' },
|
{ '<c-k>', '<up>', mode = 'c' },
|
||||||
|
|
||||||
-- quickly change background
|
-- quickly change background
|
||||||
{ '<leader>bg', [[<cmd>let &background = &background ==? 'light' ? 'dark' : 'light'<cr>]] },
|
{ '<leader>bg', [[<cmd>let &background = &background ==? 'light' ? 'dark' : 'light'<cr>]] },
|
||||||
|
|
||||||
-- navigate diagnostics
|
-- navigate diagnostics
|
||||||
{ '<leader>dj', diagnostic.goto_next },
|
{ '<leader>dj', diagnostic.goto_next },
|
||||||
{ '<leader>dk', diagnostic.goto_prev },
|
{ '<leader>dk', diagnostic.goto_prev },
|
||||||
{ '<leader>dd', diagnostic.toggle },
|
{ '<leader>dd', diagnostic.toggle },
|
||||||
{ '<leader>do', diagnostic.open_float },
|
{ '<leader>do', diagnostic.open_float },
|
||||||
{ '<leader>dh', diagnostic.hide },
|
{ '<leader>dh', diagnostic.hide },
|
||||||
|
|
||||||
telescope = {
|
telescope = {
|
||||||
{ '<leader>fa', pickers.autocommands (' Autocommands' ), desc = ' [a]utocommands' },
|
{ '<leader>fa', pickers.autocommands (' Autocommands' ), desc = ' [a]utocommands' },
|
||||||
|
@ -126,7 +126,7 @@ local keymap = {
|
||||||
--'<leader>fu'
|
--'<leader>fu'
|
||||||
--'<leader>fv'
|
--'<leader>fv'
|
||||||
{ '<leader>fw', pickers.selection (--[[dynamic]]) , desc = ' [w]word under cursor' },
|
{ '<leader>fw', pickers.selection (--[[dynamic]]) , desc = ' [w]word under cursor' },
|
||||||
{ '<leader>fw', pickers.selection (--[[dynamic]]), 'v' , desc = ' visual [s]election' },
|
{ '<leader>fw', pickers.selection (--[[dynamic]]), mode = 'v', desc = ' visual [s]election' },
|
||||||
--'<leader>fx'
|
--'<leader>fx'
|
||||||
--'<leader>fy'
|
--'<leader>fy'
|
||||||
{ '<leader>fz', pickers.spell_suggest (' Spelling suggestions') , desc = ' [z] spell suggestions' },
|
{ '<leader>fz', pickers.spell_suggest (' Spelling suggestions') , desc = ' [z] spell suggestions' },
|
||||||
|
@ -152,17 +152,17 @@ local keymap = {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- disable highlight until next search
|
-- disable highlight until next search
|
||||||
{ '<leader>h', '<cmd>nohlsearch<cr><esc>' },
|
{ '<leader>h', '<cmd>nohlsearch<cr><esc>' },
|
||||||
|
|
||||||
-- navigate items in quickfix and location lists
|
-- navigate items in quickfix and location lists
|
||||||
{ '<leader>j', '<cmd>cnext<cr>zz' },
|
{ '<leader>j', '<cmd>cnext<cr>zz' },
|
||||||
{ '<leader>k', '<cmd>cprevious<cr>zz' },
|
{ '<leader>k', '<cmd>cprevious<cr>zz' },
|
||||||
{ '<localleader>j', '<cmd>lnext<cr>zz' },
|
{ '<localleader>j', '<cmd>lnext<cr>zz' },
|
||||||
{ '<localleader>k', '<cmd>lprevious<cr>zz' },
|
{ '<localleader>k', '<cmd>lprevious<cr>zz' },
|
||||||
|
|
||||||
-- toggle quickfix and loclist
|
-- toggle quickfix and loclist
|
||||||
{ '<leader>ll', window.toggle_quickfix, desc = 'Toggle quickfix' },
|
{ '<leader>ll', window.toggle_quickfix, desc = 'Toggle quickfix' },
|
||||||
{ '<localleader>ll', window.toggle_loclist, desc = 'Toggle loclist' },
|
{ '<localleader>ll', window.toggle_loclist, desc = 'Toggle loclist' },
|
||||||
|
|
||||||
trouble = {
|
trouble = {
|
||||||
{ '<leader>lt', '<cmd>TroubleToggle<cr>' },
|
{ '<leader>lt', '<cmd>TroubleToggle<cr>' },
|
||||||
|
@ -171,7 +171,7 @@ local keymap = {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- quickly open lazy.nvim plugin manager
|
-- quickly open lazy.nvim plugin manager
|
||||||
{ '<leader>L', '<cmd>Lazy<cr>' },
|
{ '<leader>L', '<cmd>Lazy<cr>' },
|
||||||
|
|
||||||
nvim_tree = {
|
nvim_tree = {
|
||||||
{ '<leader>nn', '<cmd>NvimTreeOpen<cr>' },
|
{ '<leader>nn', '<cmd>NvimTreeOpen<cr>' },
|
||||||
|
@ -180,11 +180,11 @@ local keymap = {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- toggle options
|
-- toggle options
|
||||||
{ '<leader>sn', toggle_number },
|
{ '<leader>sn', toggle_number },
|
||||||
{ '<leader>sr', toggle_relativenumber },
|
{ '<leader>sr', toggle_relativenumber },
|
||||||
{ '<leader>sl', '<cmd>set list! | set list?<CR>' },
|
{ '<leader>sl', '<cmd>set list! | set list?<CR>' },
|
||||||
{ '<leader>sw', '<cmd>set wrap! | set wrap?<CR>' },
|
{ '<leader>sw', '<cmd>set wrap! | set wrap?<CR>' },
|
||||||
{ '<leader>ss', '<cmd>set spell! | set spell?<CR>' },
|
{ '<leader>ss', '<cmd>set spell! | set spell?<CR>' },
|
||||||
|
|
||||||
virt_column = {
|
virt_column = {
|
||||||
{ '<leader>sc', toggle_colorcolumn, desc = 'Toggle virtual colunn' },
|
{ '<leader>sc', toggle_colorcolumn, desc = 'Toggle virtual colunn' },
|
||||||
|
@ -213,16 +213,13 @@ local keymap = {
|
||||||
}
|
}
|
||||||
|
|
||||||
M.setup = function()
|
M.setup = function()
|
||||||
local keymap_set = vim.keymap.set
|
local set = vim.keymap.set
|
||||||
local set = function(opts)
|
|
||||||
local lhs, rhs, mode = opts[1], opts[2], opts[3] or 'n'
|
|
||||||
opts[1], opts[2], opts[3], opts.mode = nil, nil, nil, nil
|
|
||||||
opts.silent = opts.silent ~= false
|
|
||||||
keymap_set(mode, lhs, rhs, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
for _, mapping in ipairs(keymap) do
|
for _, map in ipairs(keymap) do
|
||||||
set(mapping)
|
local lhs, rhs, mode = map[1], map[2], map.mode or 'n'
|
||||||
|
map[1], map[2], map.mode = nil, nil, nil
|
||||||
|
map.silent = map.silent ~= false -- silent by default
|
||||||
|
set(mode, lhs, rhs, map)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
return {
|
return {
|
||||||
'norcalli/nvim-colorizer.lua',
|
'norcalli/nvim-colorizer.lua',
|
||||||
|
|
||||||
cond = vim.opt.termguicolors:get(),
|
cond = vim.opt.termguicolors:get(),
|
||||||
|
event = {
|
||||||
event = { 'BufReadPost', 'BufNewFile' },
|
'BufReadPost',
|
||||||
|
'BufNewFile'
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('colorizer').setup(nil, {
|
require('colorizer').setup(nil, {
|
||||||
css = true,
|
css = true,
|
||||||
|
|
|
@ -1,23 +1,29 @@
|
||||||
|
local repeat_mapping = function(value, keys)
|
||||||
|
local tbl = {}
|
||||||
|
for _, k in ipairs(keys) do tbl[k] = value end
|
||||||
|
return tbl
|
||||||
|
end
|
||||||
|
|
||||||
|
local transform_keymap = function(mappings, modes)
|
||||||
|
modes = modes or 'n'
|
||||||
|
modes = type(modes) == 'table' and modes or { modes }
|
||||||
|
local tbl = {}
|
||||||
|
for lhs, rhs in pairs(mappings) do
|
||||||
|
tbl[lhs] = repeat_mapping(rhs, modes)
|
||||||
|
end
|
||||||
|
return tbl
|
||||||
|
end
|
||||||
|
|
||||||
|
local cond = function(condition, yes, no)
|
||||||
|
return function(fallback)
|
||||||
|
if condition() then yes(fallback) else no(fallback) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local config = function()
|
local config = function()
|
||||||
local cmp = require 'cmp'
|
local cmp = require 'cmp'
|
||||||
local map = cmp.mapping
|
local map = cmp.mapping
|
||||||
|
|
||||||
local fs = require 'fschauen'
|
|
||||||
local flip, partial = fs.flip, fs.partial
|
|
||||||
|
|
||||||
-- assign('i', { key = func, ... }) == { key = { i = func }, ... }
|
|
||||||
-- assign({'i', 'c'}, { key = func, ... }) == { key = { i = func, c = func }, ...}
|
|
||||||
local assign_keymap = function(modes, keymap)
|
|
||||||
modes = type(modes) == 'table' and modes or { modes }
|
|
||||||
return vim.tbl_map(partial(flip(map), modes), keymap)
|
|
||||||
end
|
|
||||||
|
|
||||||
local cond = function(condition, yes, no)
|
|
||||||
return function(fallback)
|
|
||||||
if condition() then yes(fallback) else no(fallback) end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local keymap = {
|
local keymap = {
|
||||||
['<c-n>'] = cond(cmp.visible,
|
['<c-n>'] = cond(cmp.visible,
|
||||||
map.select_next_item { behavior = cmp.SelectBehavior.Select },
|
map.select_next_item { behavior = cmp.SelectBehavior.Select },
|
||||||
|
@ -42,7 +48,7 @@ local config = function()
|
||||||
}
|
}
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
mapping = assign_keymap('i', keymap),
|
mapping = transform_keymap(keymap, 'i'),
|
||||||
|
|
||||||
enabled = function()
|
enabled = function()
|
||||||
local c = require 'cmp.config.context'
|
local c = require 'cmp.config.context'
|
||||||
|
@ -128,9 +134,11 @@ local config = function()
|
||||||
}
|
}
|
||||||
|
|
||||||
cmp.setup.cmdline(':', {
|
cmp.setup.cmdline(':', {
|
||||||
mapping = assign_keymap('c', vim.tbl_extend('force', keymap, {
|
mapping = transform_keymap(
|
||||||
['<tab>'] = cond(cmp.visible, map.confirm {select = true }, map.complete()),
|
vim.tbl_extend('force', keymap, {
|
||||||
})),
|
['<tab>'] = cond(cmp.visible, map.confirm {select = true }, map.complete()),
|
||||||
|
}),
|
||||||
|
'c'),
|
||||||
|
|
||||||
completion = {
|
completion = {
|
||||||
autocomplete = false,
|
autocomplete = false,
|
||||||
|
|
|
@ -56,7 +56,6 @@ local config = function()
|
||||||
local window_is_wide = window_is_at_least(80)
|
local window_is_wide = window_is_at_least(80)
|
||||||
local window_is_medium = window_is_at_least(50)
|
local window_is_medium = window_is_at_least(50)
|
||||||
|
|
||||||
local fs = require 'fschauen'
|
|
||||||
local my = {
|
local my = {
|
||||||
paste = {
|
paste = {
|
||||||
function() return '' end,
|
function() return '' end,
|
||||||
|
@ -92,7 +91,7 @@ local config = function()
|
||||||
|
|
||||||
status = {
|
status = {
|
||||||
function()
|
function()
|
||||||
local flags = fs.concat(
|
local flags = vim.list_extend(
|
||||||
vim.bo.modified and {'+'} or {},
|
vim.bo.modified and {'+'} or {},
|
||||||
(vim.bo.readonly or not vim.bo.modifiable) and {'RO'} or {})
|
(vim.bo.readonly or not vim.bo.modifiable) and {'RO'} or {})
|
||||||
return vim.fn.join(flags, ' ')
|
return vim.fn.join(flags, ' ')
|
||||||
|
@ -141,8 +140,8 @@ local config = function()
|
||||||
|
|
||||||
|
|
||||||
local active_sections = vim.tbl_extend('force', inactive_sections, {
|
local active_sections = vim.tbl_extend('force', inactive_sections, {
|
||||||
lualine_a = fs.concat({ my.paste, my.mode }, inactive_sections.lualine_a),
|
lualine_a = vim.list_extend({ my.paste, my.mode }, inactive_sections.lualine_a),
|
||||||
lualine_x = fs.concat({ 'diagnostics' }, inactive_sections.lualine_x),
|
lualine_x = vim.list_extend({ 'diagnostics' }, inactive_sections.lualine_x),
|
||||||
})
|
})
|
||||||
|
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
return {
|
return {
|
||||||
'chr4/nginx.vim',
|
'chr4/nginx.vim',
|
||||||
|
|
||||||
ft = 'nginx',
|
ft = 'nginx',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
return {
|
return {
|
||||||
'keith/swift.vim',
|
'keith/swift.vim',
|
||||||
|
|
||||||
ft = 'swift',
|
ft = 'swift',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
return {
|
return {
|
||||||
'godlygeek/tabular',
|
'godlygeek/tabular',
|
||||||
|
cmd ={
|
||||||
|
'AddTabularPattern',
|
||||||
|
'AddTabularPipeline',
|
||||||
|
'Tabularize',
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
if vim.fn.exists('g:tabular_loaded') == 1 then
|
if vim.fn.exists('g:tabular_loaded') == 1 then
|
||||||
vim.cmd [[ AddTabularPattern! first_comma /^[^,]*\zs,/ ]]
|
vim.cmd [[ AddTabularPattern! first_comma /^[^,]*\zs,/ ]]
|
||||||
|
|
|
@ -78,6 +78,13 @@ return {
|
||||||
require('telescope').setup(opts)
|
require('telescope').setup(opts)
|
||||||
require('telescope').load_extension 'fzf'
|
require('telescope').load_extension 'fzf'
|
||||||
require('telescope').load_extension 'file_browser'
|
require('telescope').load_extension 'file_browser'
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('User', {
|
||||||
|
desc = 'Enable line number in Telescope previewers.',
|
||||||
|
group = vim.api.nvim_create_augroup('fschauen.telescope', { clear = true } ),
|
||||||
|
pattern = 'TelescopePreviewerLoaded',
|
||||||
|
command = 'setlocal number'
|
||||||
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
return {
|
return {
|
||||||
'mg979/vim-visual-multi',
|
'mg979/vim-visual-multi',
|
||||||
|
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.VM_leader = '\\'
|
vim.g.VM_leader = '\\'
|
||||||
vim.g.VM_silent_exit = 1
|
vim.g.VM_silent_exit = 1
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
local augroup = vim.api.nvim_create_augroup
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
|
||||||
|
|
||||||
local id = augroup("my_autocmds", { clear = true} )
|
|
||||||
|
|
||||||
autocmd({'BufNewFile', 'BufRead'}, {
|
|
||||||
desc = 'Make it possible to use `gf` to jump to my neovim lua modules.',
|
|
||||||
group = id,
|
|
||||||
pattern = 'init.lua',
|
|
||||||
command = "setlocal path+=~/.config/nvim/lua includeexpr=substitute(v:fname,'\\\\.','/','g')"
|
|
||||||
})
|
|
||||||
|
|
||||||
autocmd('TextYankPost', {
|
|
||||||
desc = 'Briefly highlight yanked text.',
|
|
||||||
group = id,
|
|
||||||
pattern = '*',
|
|
||||||
callback = function(_) vim.highlight.on_yank() end
|
|
||||||
})
|
|
||||||
|
|
||||||
autocmd('User', {
|
|
||||||
desc = 'Enable line number in Telescope previewers.',
|
|
||||||
group = id,
|
|
||||||
pattern = 'TelescopePreviewerLoaded',
|
|
||||||
command = 'setlocal number'
|
|
||||||
})
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
vim.diagnostic.config {
|
|
||||||
underline = false,
|
|
||||||
virtual_text = {
|
|
||||||
spacing = 6,
|
|
||||||
prefix = '●',
|
|
||||||
},
|
|
||||||
float = {
|
|
||||||
border = 'rounded',
|
|
||||||
},
|
|
||||||
severity_sort = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
local signs = {
|
|
||||||
Error = ' ',
|
|
||||||
Warn = ' ',
|
|
||||||
Info = ' ',
|
|
||||||
Hint = ' ',
|
|
||||||
}
|
|
||||||
|
|
||||||
for type, icon in pairs(signs) do
|
|
||||||
local hl = 'DiagnosticSign' .. type
|
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
|
||||||
end
|
|
|
@ -1,8 +0,0 @@
|
||||||
vim.filetype.add {
|
|
||||||
pattern = {
|
|
||||||
['${HOME}/.ssh/config.d/.*'] = 'sshconfig',
|
|
||||||
['.*/ssh/config'] = 'sshconfig',
|
|
||||||
['.*/git/config'] = 'gitconfig',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
P = function(v)
|
|
||||||
print(vim.inspect(v))
|
|
||||||
return v
|
|
||||||
end
|
|
||||||
|
|
||||||
PP = function(v)
|
|
||||||
vim.print(v)
|
|
||||||
return v
|
|
||||||
end
|
|
||||||
|
|
||||||
RELOAD = function(...)
|
|
||||||
return require('plenary.reload').reload_module(...)
|
|
||||||
end
|
|
||||||
|
|
||||||
R = function(name)
|
|
||||||
RELOAD(name)
|
|
||||||
return require(name)
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
local lazy = (function()
|
|
||||||
local path = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
|
||||||
if not vim.loop.fs_stat(path) then
|
|
||||||
vim.fn.system {
|
|
||||||
'git',
|
|
||||||
'clone',
|
|
||||||
'--filter=blob:none',
|
|
||||||
'--branch=stable',
|
|
||||||
'https://github.com/folke/lazy.nvim.git',
|
|
||||||
path,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(path)
|
|
||||||
return vim.F.npcall(require, 'lazy')
|
|
||||||
end)()
|
|
||||||
|
|
||||||
if lazy then
|
|
||||||
lazy.setup {
|
|
||||||
spec = 'fschauen.plugins',
|
|
||||||
-- defaults = {
|
|
||||||
-- lazy = true,
|
|
||||||
-- },
|
|
||||||
dev = {
|
|
||||||
path = '~/Projects/nvim-plugins',
|
|
||||||
fallback = true,
|
|
||||||
},
|
|
||||||
ui = {
|
|
||||||
border = 'rounded',
|
|
||||||
title = ' Lazy ',
|
|
||||||
},
|
|
||||||
performance = {
|
|
||||||
rtp = {
|
|
||||||
disabled_plugins = {
|
|
||||||
'gzip',
|
|
||||||
'matchit',
|
|
||||||
'matchparen',
|
|
||||||
'netrwPlugin',
|
|
||||||
'tarPlugin',
|
|
||||||
'tohtml',
|
|
||||||
'tutor',
|
|
||||||
'zipPlugin',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else
|
|
||||||
vim.notify('Lazy not installed and failed to bootstrap!', vim.log.levels.WARN)
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,133 +0,0 @@
|
||||||
vim.cmd [[let &t_8f = "\<ESC>[38:2:%lu:%lu:%lum"]]
|
|
||||||
vim.cmd [[let &t_8b = "\<ESC>[48:2:%lu:%lu:%lum"]]
|
|
||||||
|
|
||||||
local o = vim.opt
|
|
||||||
|
|
||||||
-- General
|
|
||||||
o.belloff = 'all' -- never ring bells
|
|
||||||
o.hidden = true -- hide abandoned buffers
|
|
||||||
o.clipboard = 'unnamedplus' -- synchronize with system clipboard
|
|
||||||
o.lazyredraw = true -- don't redraw screen during macros
|
|
||||||
o.modelines = 0 -- never use modelines
|
|
||||||
o.fileformats = 'unix,mac,dos' -- prioritize unix <EOL> format
|
|
||||||
o.pastetoggle = '<F20>' -- toggle paste with P on Moonlander
|
|
||||||
|
|
||||||
o.swapfile = false -- don't use swap files
|
|
||||||
o.writebackup = true -- Make a backup before writing a file...
|
|
||||||
o.backup = false -- ...but don't keep it around.
|
|
||||||
o.undofile = true -- write undo history
|
|
||||||
|
|
||||||
o.shortmess:append 'I' -- no intro message when starting Vim
|
|
||||||
o.shada = {
|
|
||||||
"'1000", -- remember marks for this many files
|
|
||||||
"/1000", -- remember this many search patterns
|
|
||||||
":1000", -- remember this many command line items
|
|
||||||
"<100", -- maximum number of lines to remember per register
|
|
||||||
"h", -- disable 'hlsearch' while reading shada file
|
|
||||||
"s100", -- limit size of remembered items to this many KiB
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Searching
|
|
||||||
o.ignorecase = true -- Ignore case when searching...
|
|
||||||
o.smartcase = true -- ...unless pattern contains uppercase characters.
|
|
||||||
o.wrapscan = false -- Don't wrap around the end of the file when searching.
|
|
||||||
|
|
||||||
-- Editing
|
|
||||||
o.expandtab = true -- use spaces when <Tab> is inserted
|
|
||||||
o.tabstop = 4 -- tabs are 4 spaces
|
|
||||||
o.shiftwidth = 0 -- (auto)indent using 'tabstop' spaces
|
|
||||||
o.smartindent = true -- use smart autoindenting
|
|
||||||
o.inccommand = 'split' -- preview command partial results
|
|
||||||
o.joinspaces = false -- use one space after a period whe joining lines
|
|
||||||
o.showmatch = true -- briefly jump to matching bracket if insert one
|
|
||||||
o.virtualedit = 'block' -- position the cursor anywhere in Visual Block mode
|
|
||||||
o.formatlistpat = [[^\s*\(\d\+[\]:.)}\t ]\|[-+*]\|[\[(][ x][\])]\)\s*]]
|
|
||||||
o.completeopt = {
|
|
||||||
'menu', -- show completions in a popup menu
|
|
||||||
'preview', -- show extra information about the selected match
|
|
||||||
'noinsert', -- don't insert text until I select a match
|
|
||||||
'noselect', -- don't pre-select the first match in the menu
|
|
||||||
}
|
|
||||||
|
|
||||||
local fmt = o.formatoptions
|
|
||||||
fmt:remove 't' -- Don't auto-wrap on 'textwidth'...
|
|
||||||
fmt:append 'c' -- ...but do it within comment blocks...
|
|
||||||
fmt:append 'l' -- ...but not if line was already long before entering Insert mode.
|
|
||||||
fmt:append 'r' -- Insert comment leader when pressing Enter...
|
|
||||||
fmt:remove 'o' -- ...but not when opening a new line with o & O.
|
|
||||||
fmt:append 'q' -- allow formatting of comments with gq
|
|
||||||
fmt:remove 'a' -- don't auto-format every time text is inserted
|
|
||||||
fmt:append 'n' -- indent lists automatically acc. 'formatlistpat'
|
|
||||||
fmt:append 'j' -- remove comment leader when joining lines
|
|
||||||
fmt:append '1' -- don't break lines after a one letter word but rather before it
|
|
||||||
|
|
||||||
-- Appearance
|
|
||||||
o.termguicolors = true -- use "gui" :higlight instead of "cterm"
|
|
||||||
o.showmode = false -- don't show mode (shown in statusline instead)
|
|
||||||
o.relativenumber = true -- Start off with relative line numbers...
|
|
||||||
o.number = true -- ...but real number for current line.
|
|
||||||
o.wrap = false -- don't wrap long lines initially
|
|
||||||
o.textwidth = 80 -- maximum width for text being inserted
|
|
||||||
o.colorcolumn = '+1' -- highlight column after 'textwidth'
|
|
||||||
o.cursorline = true -- highlight the line of the cursor...
|
|
||||||
o.cursorlineopt = 'number'-- ...but only the line number
|
|
||||||
o.showbreak = '⤷ ' -- prefix for wrapped lines
|
|
||||||
o.scrolloff = 3 -- min. # of lines above and below cursor
|
|
||||||
o.sidescrolloff = 3 -- min. # of columns to left and right of cursor
|
|
||||||
o.signcolumn = 'number' -- display signs in 'number' column
|
|
||||||
o.list = false -- don't show invisible characters initially
|
|
||||||
o.listchars = {
|
|
||||||
eol = '↲',
|
|
||||||
tab = '» ',
|
|
||||||
extends = '…',
|
|
||||||
precedes = '…',
|
|
||||||
trail = '·',
|
|
||||||
conceal = '┊',
|
|
||||||
}
|
|
||||||
o.fillchars = {
|
|
||||||
diff = '⋅',
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Wildcard Expansion
|
|
||||||
o.wildignore = {
|
|
||||||
'.git',
|
|
||||||
'.svn',
|
|
||||||
'__pycache__',
|
|
||||||
'**/tmp/**',
|
|
||||||
'*.DS_Store',
|
|
||||||
'*.dll',
|
|
||||||
'*.egg-info',
|
|
||||||
'*.exe',
|
|
||||||
'*.gif',
|
|
||||||
'*.jpeg',
|
|
||||||
'*.jpg',
|
|
||||||
'*.o',
|
|
||||||
'*.obj',
|
|
||||||
'*.out',
|
|
||||||
'*.png',
|
|
||||||
'*.pyc',
|
|
||||||
'*.so',
|
|
||||||
'*.zip',
|
|
||||||
'*~',
|
|
||||||
}
|
|
||||||
o.wildignorecase = true -- ignore case when completing file names
|
|
||||||
o.wildmode = 'longest:full' -- longest common prefix first, then wildmenu
|
|
||||||
|
|
||||||
-- Window Splitting
|
|
||||||
o.splitbelow = true -- :split below current window
|
|
||||||
o.splitright = true -- :vsplit to the right of current window
|
|
||||||
o.equalalways = false -- don't resize all windows when splitting
|
|
||||||
|
|
||||||
-- Folding
|
|
||||||
o.foldenable = true -- enable folding
|
|
||||||
o.foldlevelstart = 100 -- start with all folds open
|
|
||||||
o.foldmethod = 'syntax' -- fold based on syntax by default
|
|
||||||
o.foldnestmax = 10 -- limit nested folds to 10 levels
|
|
||||||
|
|
||||||
-- Options for diff mode
|
|
||||||
o.diffopt = { -- better side-by-side diffs
|
|
||||||
'filler', -- show filler lines (so text is vertically synced)
|
|
||||||
'vertical', -- use vertical splits (files side-by-side)
|
|
||||||
'closeoff', -- disable diff mode when one window is closed
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue