initial commit
This commit is contained in:
commit
23d4795228
99 changed files with 6691 additions and 0 deletions
75
config/nvim/plugin/autocmds.lua
Normal file
75
config/nvim/plugin/autocmds.lua
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
local api, au = vim.api, vim.api.nvim_create_autocmd
|
||||
|
||||
local aug = api.nvim_create_augroup('AAugs', { clear = true })
|
||||
|
||||
au('BufEnter', {
|
||||
command = 'setl formatoptions-=cro spelloptions=camel,noplainbuffer',
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au({ 'TermOpen', 'BufWinEnter' }, {
|
||||
callback = function(args)
|
||||
if vim.bo[args.buf].buftype == 'terminal' then
|
||||
vim.opt_local.number = true
|
||||
vim.opt_local.relativenumber = true
|
||||
vim.cmd.startinsert()
|
||||
end
|
||||
end,
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au('BufWritePost', {
|
||||
pattern = (
|
||||
os.getenv('XDG_CONFIG_HOME') or (os.getenv('HOME') .. '/.config')
|
||||
) .. '/dunst/dunstrc',
|
||||
callback = function()
|
||||
vim.fn.system('killall dunst && nohup dunst &; disown')
|
||||
end,
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au('BufReadPost', {
|
||||
command = 'sil! normal g`"',
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au({ 'BufRead', 'BufNewFile' }, {
|
||||
pattern = '*/templates/*.html',
|
||||
callback = function(opts)
|
||||
vim.api.nvim_set_option_value(
|
||||
'filetype',
|
||||
'htmldjango',
|
||||
{ buf = opts.buf }
|
||||
)
|
||||
end,
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = 'Visual', timeout = 300 })
|
||||
end,
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au({ 'FocusLost', 'BufLeave', 'VimLeave' }, {
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
vim.cmd('silent! wall')
|
||||
end,
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au({ 'VimEnter', 'BufWinEnter', 'BufEnter' }, {
|
||||
callback = function()
|
||||
vim.api.nvim_set_option_value('cursorline', true, { scope = 'local' })
|
||||
end,
|
||||
group = aug,
|
||||
})
|
||||
|
||||
au('WinLeave', {
|
||||
callback = function()
|
||||
vim.api.nvim_set_option_value('cursorline', false, { scope = 'local' })
|
||||
end,
|
||||
group = aug,
|
||||
})
|
||||
1
config/nvim/plugin/fold.lua
Normal file
1
config/nvim/plugin/fold.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require('config.fold').setup()
|
||||
68
config/nvim/plugin/keymaps.lua
Normal file
68
config/nvim/plugin/keymaps.lua
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
map({
|
||||
'n',
|
||||
'gx',
|
||||
function()
|
||||
local url = vim.fn.expand('<cfile>', nil)
|
||||
|
||||
if not url:match('https') and url:match('/') then
|
||||
url = 'https://github.com/' .. url
|
||||
end
|
||||
|
||||
vim.fn.jobstart({ vim.env.BROWSER, url })
|
||||
end,
|
||||
})
|
||||
|
||||
map({ { 'i', 'c' }, '<c-a>', '<esc>' })
|
||||
|
||||
for key, cmd in pairs({
|
||||
left = 'vertical resize -10',
|
||||
right = 'vertical resize +10',
|
||||
down = 'resize +10',
|
||||
up = 'resize -10',
|
||||
}) do
|
||||
map({
|
||||
'n',
|
||||
('<%s>'):format(key),
|
||||
function()
|
||||
vim.cmd(cmd)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
map({ 'n', 'J', 'mzJ`z' })
|
||||
|
||||
map({ 'x', 'p', '"_dp' })
|
||||
map({ 'x', 'P', '"_dP' })
|
||||
map({ 't', '<esc>', '<c-\\><c-n>' })
|
||||
|
||||
map({ 'n', '<leader>iw', '<cmd>setlocal wrap!<cr>' })
|
||||
map({ 'n', '<leader>is', '<cmd>setlocal spell!<cr>' })
|
||||
local state = nil
|
||||
|
||||
map({
|
||||
'n',
|
||||
'<leader>iz',
|
||||
function()
|
||||
if state then
|
||||
for k, v in pairs(state) do
|
||||
vim.opt_local[k] = v
|
||||
end
|
||||
state = nil
|
||||
else
|
||||
state = {
|
||||
number = vim.opt_local.number:get(),
|
||||
relativenumber = vim.opt_local.relativenumber:get(),
|
||||
signcolumn = vim.opt_local.signcolumn:get(),
|
||||
statuscolumn = vim.opt_local.statuscolumn:get(),
|
||||
laststatus = vim.opt_local.laststatus:get(),
|
||||
cmdheight = vim.opt_local.cmdheight:get(),
|
||||
}
|
||||
vim.opt_local.number = false
|
||||
vim.opt_local.relativenumber = false
|
||||
vim.opt_local.signcolumn = 'no'
|
||||
vim.opt_local.statuscolumn = ''
|
||||
vim.opt_local.laststatus = 0
|
||||
vim.opt_local.cmdheight = 0
|
||||
end
|
||||
end,
|
||||
})
|
||||
1
config/nvim/plugin/lines.lua
Normal file
1
config/nvim/plugin/lines.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require('config.lines').setup()
|
||||
76
config/nvim/plugin/options.lua
Normal file
76
config/nvim/plugin/options.lua
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
local o, opt = vim.o, vim.opt
|
||||
|
||||
o.autowrite = true
|
||||
|
||||
o.breakindent = true
|
||||
|
||||
o.conceallevel = 0
|
||||
|
||||
opt.diffopt:append('linematch:60')
|
||||
|
||||
o.expandtab = true
|
||||
|
||||
o.exrc = true
|
||||
o.secure = true
|
||||
|
||||
opt.foldcolumn = 'auto:1'
|
||||
opt.signcolumn = 'no'
|
||||
|
||||
opt.fillchars = {
|
||||
eob = ' ',
|
||||
vert = '│',
|
||||
diff = '╱',
|
||||
}
|
||||
|
||||
opt.iskeyword:append('-')
|
||||
|
||||
o.laststatus = 3
|
||||
|
||||
o.linebreak = true
|
||||
|
||||
o.list = true
|
||||
opt.listchars = {
|
||||
space = ' ',
|
||||
trail = '·',
|
||||
tab = ' ',
|
||||
}
|
||||
|
||||
opt.matchpairs:append('<:>')
|
||||
|
||||
o.number = true
|
||||
o.relativenumber = true
|
||||
|
||||
opt.path:append('**')
|
||||
|
||||
o.scrolloff = 8
|
||||
|
||||
o.shiftwidth = 2
|
||||
|
||||
opt.shortmess:append('acCIs')
|
||||
|
||||
o.showmode = false
|
||||
|
||||
o.showtabline = 0
|
||||
|
||||
o.spellfile = (vim.env.XDG_DATA_HOME or (vim.env.HOME .. '/.local/share'))
|
||||
.. '/nvim/spell.encoding.add'
|
||||
|
||||
o.splitkeep = 'screen'
|
||||
|
||||
o.splitbelow = true
|
||||
o.splitright = true
|
||||
|
||||
o.swapfile = false
|
||||
|
||||
o.termguicolors = true
|
||||
|
||||
o.undodir = (vim.env.XDG_DATA_HOME or (vim.env.HOME .. '/.local/share'))
|
||||
.. '/nvim/undo'
|
||||
o.undofile = true
|
||||
|
||||
o.updatetime = 50
|
||||
|
||||
o.winborder = 'single'
|
||||
o.winbar = ''
|
||||
|
||||
o.wrap = false
|
||||
Loading…
Add table
Add a link
Reference in a new issue