mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-24 16:28:22 -05:00
neovim: configure packer.nvim + add iswap.nvim
This commit is contained in:
parent
a8e3fb728b
commit
dfcfbd004a
@ -1,2 +1,3 @@
|
|||||||
|
setlocal spell
|
||||||
setlocal wrap
|
setlocal wrap
|
||||||
" setlocal nonumber norelativenumber
|
" setlocal nonumber norelativenumber
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
setlocal spell
|
||||||
setlocal wrap
|
setlocal wrap
|
||||||
" setlocal nonumber norelativenumber
|
" setlocal nonumber norelativenumber
|
||||||
|
@ -2,7 +2,7 @@ local async
|
|||||||
async = vim.loop.new_async(vim.schedule_wrap(function()
|
async = vim.loop.new_async(vim.schedule_wrap(function()
|
||||||
require('plugins')
|
require('plugins')
|
||||||
require('mappings')
|
require('mappings')
|
||||||
require('events').load_autocmds()
|
require('autocmd')
|
||||||
async:close()
|
async:close()
|
||||||
end))
|
end))
|
||||||
|
|
||||||
|
49
home/.config/nvim/lua/autocmd.lua
Normal file
49
home/.config/nvim/lua/autocmd.lua
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
local definitions = {
|
||||||
|
-- ':h hex-editing'
|
||||||
|
binary = {
|
||||||
|
{'BufReadPre' , '*.bin,*.exe', 'let &bin=1'},
|
||||||
|
{'BufReadPost' , '*.bin,*.exe', 'if &bin | %!xxd'},
|
||||||
|
{'BufReadPost' , '*.bin,*.exe', 'set ft=xxd | endif'},
|
||||||
|
{'BufWritePre' , '*.bin,*.exe', 'if &bin | %!xxd -r'},
|
||||||
|
{'BufWritePre' , '*.bin,*.exe', 'endif'},
|
||||||
|
{'BufWritePost', '*.bin,*.exe', 'if &bin | %!xxd'},
|
||||||
|
{'BufWritePost', '*.bin,*.exe', 'set nomod | endif'}
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Auto-hide UI elements in specific buffers
|
||||||
|
buf = {
|
||||||
|
{'BufEnter', 'term://*', 'setlocal norelativenumber nonumber'},
|
||||||
|
-- {'BufEnter,BufWinEnter,WinEnter,CmdwinEnter', '*', [[if bufname('%') == 'NvimTree' | set laststatus=0 | else | set laststatus=2 | endif]]}
|
||||||
|
},
|
||||||
|
|
||||||
|
wins = {
|
||||||
|
-- Equalize window dimensions when resizing vim window
|
||||||
|
{'VimResized', '*', 'tabdo wincmd ='},
|
||||||
|
-- Force writing shada on leaving nvim
|
||||||
|
{'VimLeave', '*', [[if has('nvim') | wshada! | else | wviminfo! | endif]]},
|
||||||
|
-- Check if file changed when its window is focus, more eager than 'autoread'
|
||||||
|
{'FocusGained', '* checktime'}
|
||||||
|
},
|
||||||
|
|
||||||
|
ft = {
|
||||||
|
{'BufNewFile,BufRead', '*.md,*.mkd', 'setfiletype markdown'},
|
||||||
|
{'BufNewFile,BufRead', '*.toml', 'setfiletype toml'},
|
||||||
|
{'BufNewFile,BufRead', '*.rasi', 'setfiletype css'},
|
||||||
|
{'BufNewFile,BufRead', 'vifmrc,*.vifm', 'setfiletype vim'},
|
||||||
|
{'BufNewFile,BufRead', '*.log,*_log,*.LO,G*_LOG', 'setfiletype log'}
|
||||||
|
},
|
||||||
|
|
||||||
|
yank = {
|
||||||
|
{'TextYankPost', [[* silent! lua vim.highlight.on_yank({higroup='IncSearch', timeout=300})]]}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for group_name, definition in pairs(definitions) do
|
||||||
|
vim.api.nvim_command('augroup ' .. group_name)
|
||||||
|
vim.api.nvim_command('autocmd!')
|
||||||
|
for _, def in ipairs(definition) do
|
||||||
|
local command = table.concat(vim.tbl_flatten{'autocmd', def}, ' ')
|
||||||
|
vim.api.nvim_command(command)
|
||||||
|
end
|
||||||
|
vim.api.nvim_command('augroup END')
|
||||||
|
end
|
@ -297,22 +297,15 @@ local function highlight_plugins()
|
|||||||
hi('rainbowcol6', c.blue, '', 'bold', '')
|
hi('rainbowcol6', c.blue, '', 'bold', '')
|
||||||
hi('rainbowcol7', c.purple, '', 'bold', '')
|
hi('rainbowcol7', c.purple, '', 'bold', '')
|
||||||
|
|
||||||
-- todo-comments
|
|
||||||
hi('TodoDefault', c.fg, '', 'bold', '')
|
|
||||||
hi('TodoError', c.red, '', 'bold', '')
|
|
||||||
hi('TodoWarn', c.yellow, '', 'bold', '')
|
|
||||||
hi('TodoInfo', c.blue, '', 'bold', '')
|
|
||||||
hi('TodoHint', c.cyan, '', 'bold', '')
|
|
||||||
|
|
||||||
-- hop.nvim
|
-- hop.nvim
|
||||||
hi('HopNextKey', c.red, '', 'bold', '')
|
hi('HopNextKey', c.red, '', 'bold', '')
|
||||||
hi('HopNextKey1', c.cyan, '', 'bold', '')
|
hi('HopNextKey1', c.cyan, '', 'bold', '')
|
||||||
hi('HopNextKey2', c.dark_blue, '', '', '')
|
hi('HopNextKey2', c.dark_blue, '', '', '')
|
||||||
hi('HopUnmatched', c.grey3, '', '', '')
|
vim.api.nvim_command('hi! link HopUnmatched LineNr')
|
||||||
|
|
||||||
-- vim-eft
|
-- vim-eft
|
||||||
hi('EftChar' , c.orange, '', 'bold,underline', '')
|
hi('EftChar', c.orange, '', 'bold,underline', '')
|
||||||
hi('EftSubChar', c.grey3, '', 'bold,underline', '')
|
vim.api.nvim_command('hi! link EftSubChar LineNr')
|
||||||
|
|
||||||
-- dashboard-nvim / alpha-nvim
|
-- dashboard-nvim / alpha-nvim
|
||||||
hi('DashboardHeader' , c.blue , '', 'bold' , '')
|
hi('DashboardHeader' , c.blue , '', 'bold' , '')
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
local plug_dir = vim.fn.stdpath('config') .. '/lua'
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
function M.packer_compile()
|
|
||||||
local file = vim.fn.expand('%:p')
|
|
||||||
if file:match(plug_dir) then
|
|
||||||
vim.api.nvim_command('source <afile> | PackerCompile')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.nvim_create_augroups(definitions)
|
|
||||||
for group_name, definition in pairs(definitions) do
|
|
||||||
vim.api.nvim_command('augroup ' .. group_name)
|
|
||||||
vim.api.nvim_command('autocmd!')
|
|
||||||
for _, def in ipairs(definition) do
|
|
||||||
local command = table.concat(vim.tbl_flatten{'autocmd', def}, ' ')
|
|
||||||
vim.api.nvim_command(command)
|
|
||||||
end
|
|
||||||
vim.api.nvim_command('augroup END')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.load_autocmds()
|
|
||||||
local definitions = {
|
|
||||||
plugins = {
|
|
||||||
-- Wrap lines in preview window
|
|
||||||
-- {"User TelescopePreviewerLoaded", [[setlocal wrap]]},
|
|
||||||
|
|
||||||
-- Re-compile packer on config changed
|
|
||||||
{"BufWritePost", "*.lua", "lua require('events').packer_compile()"},
|
|
||||||
|
|
||||||
-- Register binding for ToggleTerm inside term mode
|
|
||||||
{"TermEnter", "term://*toggleterm#*", "tnoremap <silent><C-\\> <C-\\><C-n>:ToggleTerm<CR>"}
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Edit binary files in hex with xxd (:%!xxd and :%!xxd -r)
|
|
||||||
-- or using nvim -b to edit files using xxd-format
|
|
||||||
binary = {
|
|
||||||
{"BufReadPre" , "*.bin,*.exe", "let &bin=1"},
|
|
||||||
{"BufReadPost" , "*.bin,*.exe", "if &bin | %!xxd"},
|
|
||||||
{"BufReadPost" , "*.bin,*.exe", "set ft=xxd | endif"},
|
|
||||||
{"BufWritePre" , "*.bin,*.exe", "if &bin | %!xxd -r"},
|
|
||||||
{"BufWritePre" , "*.bin,*.exe", "endif"},
|
|
||||||
{"BufWritePost", "*.bin,*.exe", "if &bin | %!xxd"},
|
|
||||||
{"BufWritePost", "*.bin,*.exe", "set nomod | endif"}
|
|
||||||
},
|
|
||||||
|
|
||||||
buf = {
|
|
||||||
-- Auto-spelling in doc files
|
|
||||||
{"BufNewFile,BufRead", "*.md,*.mkd", "setlocal spell"},
|
|
||||||
{"BufNewFile,BufRead", "*.tex", "setlocal spell"},
|
|
||||||
|
|
||||||
-- Auto-hide numbers, statusline in specific buffers
|
|
||||||
-- {"BufEnter", "term://*", "setlocal norelativenumber nonumber"},
|
|
||||||
-- {"BufEnter", "term://*", "set laststatus=0"},
|
|
||||||
-- {"BufEnter,BufWinEnter,WinEnter,CmdwinEnter", "*", [[if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif]]}
|
|
||||||
},
|
|
||||||
|
|
||||||
wins = {
|
|
||||||
-- Equalize window dimensions when resizing vim window
|
|
||||||
{"VimResized", "*", [[tabdo wincmd =]]},
|
|
||||||
|
|
||||||
-- Force writing shada on leaving nvim
|
|
||||||
{"VimLeave", "*", [[if has('nvim') | wshada! | else | wviminfo! | endif]]},
|
|
||||||
|
|
||||||
-- Check if file changed when its window is focus, more eager than 'autoread'
|
|
||||||
{"FocusGained", "* checktime"}
|
|
||||||
},
|
|
||||||
|
|
||||||
ft = {
|
|
||||||
{"BufNewFile,BufRead", "*.md,*.mkd", "setfiletype markdown"},
|
|
||||||
{"BufNewFile,BufRead", "*.toml", "setfiletype toml"},
|
|
||||||
{"BufNewFile,BufRead", "*.rasi", "setfiletype css"},
|
|
||||||
{"BufNewFile,BufRead", "vifmrc,*.vifm", "setfiletype vim"},
|
|
||||||
{"BufNewFile,BufRead", "*.log,*_log,*.LO,G*_LOG", "setfiletype log"}
|
|
||||||
},
|
|
||||||
|
|
||||||
yank = {
|
|
||||||
{"TextYankPost", [[* silent! lua vim.highlight.on_yank({higroup="IncSearch", timeout=300})]]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
M.nvim_create_augroups(definitions)
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
@ -52,10 +52,10 @@ wk.register({
|
|||||||
L = {'$', 'End of the line'},
|
L = {'$', 'End of the line'},
|
||||||
|
|
||||||
-- Easier moving between windows
|
-- Easier moving between windows
|
||||||
['<C-h>'] = {'<C-w>h', 'Go to the left window'},
|
-- ['<C-h>'] = {'<C-w>h', 'Go to the left window'},
|
||||||
['<C-l>'] = {'<C-w>l', 'Go to the right window'},
|
-- ['<C-l>'] = {'<C-w>l', 'Go to the right window'},
|
||||||
['<C-j>'] = {'<C-w>j', 'Go to the down window'},
|
-- ['<C-j>'] = {'<C-w>j', 'Go to the down window'},
|
||||||
['<C-k>'] = {'<C-w>k', 'Go to the up window'},
|
-- ['<C-k>'] = {'<C-w>k', 'Go to the up window'},
|
||||||
['<C-q>'] = {'<C-w>q', 'Quit a window'},
|
['<C-q>'] = {'<C-w>q', 'Quit a window'},
|
||||||
|
|
||||||
-- Copy the whole buffer
|
-- Copy the whole buffer
|
||||||
@ -133,7 +133,11 @@ wk.register({
|
|||||||
-- Normal mode (with leader key) --
|
-- Normal mode (with leader key) --
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
wk.register({
|
wk.register({
|
||||||
a = {':EasyAlign<CR>', 'Align'},
|
a = {
|
||||||
|
name = 'Action',
|
||||||
|
a = {':EasyAlign<CR>', 'Align elements'},
|
||||||
|
s = {':ISwapWith<CR>', 'Swap elements'}
|
||||||
|
},
|
||||||
|
|
||||||
b = {
|
b = {
|
||||||
name = 'Buffer/Tab',
|
name = 'Buffer/Tab',
|
||||||
@ -315,7 +319,10 @@ wk.register({
|
|||||||
-- Visual mode (with leader key) --
|
-- Visual mode (with leader key) --
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
wk.register({
|
wk.register({
|
||||||
a = {':EasyAlign<CR>', 'Range align'},
|
a = {
|
||||||
|
name = 'Action',
|
||||||
|
a = {':EasyAlign<CR>', 'Range align'}
|
||||||
|
},
|
||||||
|
|
||||||
d = {
|
d = {
|
||||||
name = 'DAP',
|
name = 'DAP',
|
||||||
|
@ -54,7 +54,7 @@ function M.cmp_conf()
|
|||||||
nvim_lsp = '[LSP]',
|
nvim_lsp = '[LSP]',
|
||||||
-- cmp_tabnine = '[TN]',
|
-- cmp_tabnine = '[TN]',
|
||||||
latex_symbols = '[TEX]',
|
latex_symbols = '[TEX]',
|
||||||
tmux = '[TMUX]',
|
-- tmux = '[TMUX]',
|
||||||
orgmode = '[ORG]'
|
orgmode = '[ORG]'
|
||||||
})[entry.source.name]
|
})[entry.source.name]
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ function M.cmp_conf()
|
|||||||
-- {name = 'cmp_tabnine'},
|
-- {name = 'cmp_tabnine'},
|
||||||
{name = 'conjure'},
|
{name = 'conjure'},
|
||||||
{name = 'latex_symbols'},
|
{name = 'latex_symbols'},
|
||||||
{name = 'tmux'},
|
-- {name = 'tmux'},
|
||||||
{name = 'orgmode'}
|
{name = 'orgmode'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,7 @@ function M.treesitter_conf()
|
|||||||
textobjects = {
|
textobjects = {
|
||||||
select = {
|
select = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
lookahead = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
['af'] = '@function.outer',
|
['af'] = '@function.outer',
|
||||||
['if'] = '@function.inner',
|
['if'] = '@function.inner',
|
||||||
@ -98,6 +99,34 @@ function M.treesitter_conf()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.iswap_conf()
|
||||||
|
require('iswap').setup {
|
||||||
|
-- The keys that will be used as a selection, in order
|
||||||
|
-- ('asdfghjklqwertyuiopzxcvbnm' by default)
|
||||||
|
-- keys = 'qwertyuiop',
|
||||||
|
|
||||||
|
-- Grey out the rest of the text when making a selection
|
||||||
|
-- (enabled by default)
|
||||||
|
-- grey = 'disable',
|
||||||
|
|
||||||
|
-- Highlight group for the sniping value (asdf etc.)
|
||||||
|
-- default 'Search'
|
||||||
|
-- hl_snipe = 'ErrorMsg',
|
||||||
|
|
||||||
|
-- Highlight group for the visual selection of terms
|
||||||
|
-- default 'Visual'
|
||||||
|
-- hl_selection = 'WarningMsg',
|
||||||
|
|
||||||
|
-- Highlight group for the greyed background
|
||||||
|
-- default 'Comment'
|
||||||
|
hl_grey = 'LineNr',
|
||||||
|
|
||||||
|
-- Automatically swap with only two arguments
|
||||||
|
-- default nil
|
||||||
|
autoswap = true
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
function M.rainbow_conf()
|
function M.rainbow_conf()
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
rainbow = {
|
rainbow = {
|
||||||
|
@ -228,11 +228,11 @@ end
|
|||||||
-- exclude = {'org'}, -- list of file types to exclude highlighting
|
-- exclude = {'org'}, -- list of file types to exclude highlighting
|
||||||
-- },
|
-- },
|
||||||
-- colors = {
|
-- colors = {
|
||||||
-- error = {'TodoError', 'Red'},
|
-- error = {'LspDiagnosticsDefaultError', 'Red'},
|
||||||
-- warning = {'TodoWarn', 'Yellow'},
|
-- warning = {'LspDiagnosticsDefaultWarning', 'Yellow'},
|
||||||
-- info = {'TodoInfo', 'Blue'},
|
-- info = {'LspDiagnosticsDefaultInformation', 'Blue'},
|
||||||
-- hint = {'TodoHint', 'Cyan'},
|
-- hint = {'LspDiagnosticsDefaultHint', 'Cyan'},
|
||||||
-- default = {'TodoDefault', 'White'}
|
-- default = {'Normal', 'White'}
|
||||||
-- },
|
-- },
|
||||||
-- search = {
|
-- search = {
|
||||||
-- command = 'rg',
|
-- command = 'rg',
|
||||||
|
65
home/.config/nvim/lua/modules/pack.lua
Normal file
65
home/.config/nvim/lua/modules/pack.lua
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
local fn, api = vim.fn, vim.api
|
||||||
|
|
||||||
|
-- Require since we use 'packer' as opt
|
||||||
|
api.nvim_command('packadd packer.nvim')
|
||||||
|
local present, packer = pcall(require, 'packer')
|
||||||
|
|
||||||
|
if not present then
|
||||||
|
local packer_dir = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
||||||
|
|
||||||
|
print('Cloning packer ...')
|
||||||
|
-- remove packer_dir before cloning
|
||||||
|
fn.delete(packer_dir, 'rf')
|
||||||
|
fn.system {'git', 'clone', 'https://github.com/wbthomason/packer.nvim', packer_dir}
|
||||||
|
api.nvim_command('packadd packer.nvim')
|
||||||
|
present, packer = pcall(require, 'packer')
|
||||||
|
|
||||||
|
if present then
|
||||||
|
print('Pakcer cloned successfully.')
|
||||||
|
else
|
||||||
|
error('Git clone error for packer!')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local util = require('packer.util')
|
||||||
|
|
||||||
|
packer.init {
|
||||||
|
compile_path = util.join_paths(fn.stdpath('data'), 'site', 'plugin', 'packer_compiled.lua'),
|
||||||
|
auto_clean = true,
|
||||||
|
compile_on_sync = true,
|
||||||
|
auto_reload_compiled = true,
|
||||||
|
git = {
|
||||||
|
-- default_url_format = 'https://github.com/%s',
|
||||||
|
clone_timeout = 120
|
||||||
|
},
|
||||||
|
display = {
|
||||||
|
-- open_fn = function()
|
||||||
|
-- return util.float {border = 'single'}
|
||||||
|
-- end,
|
||||||
|
open_cmd = '60vnew \\[packer\\]',
|
||||||
|
working_sym = '⟳',
|
||||||
|
error_sym = '✗',
|
||||||
|
done_sym = '✓',
|
||||||
|
removed_sym = '-',
|
||||||
|
moved_sym = '→',
|
||||||
|
header_sym = '━',
|
||||||
|
show_all_info = true,
|
||||||
|
prompt_boder = 'single'
|
||||||
|
},
|
||||||
|
-- profile = {enable = true, threshold = 1},
|
||||||
|
luarocks = {python_cmd = 'python3'}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Re-compile packer on config changed
|
||||||
|
_G.packer_compile_on_save = function()
|
||||||
|
local file = fn.expand('%:p')
|
||||||
|
local filename = fn.expand('%:p:t')
|
||||||
|
local config_dir = fn.stdpath('config') .. '/lua'
|
||||||
|
|
||||||
|
if file:match(config_dir) and filename ~= 'pack.lua' then
|
||||||
|
vim.api.nvim_command('source <afile> | PackerCompile')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
api.nvim_command('autocmd BufWritePost *.lua lua packer_compile_on_save()')
|
||||||
|
|
||||||
|
return packer
|
@ -46,6 +46,9 @@ function M.telescope_conf()
|
|||||||
require('telescope').load_extension('projects')
|
require('telescope').load_extension('projects')
|
||||||
require('telescope').load_extension('project')
|
require('telescope').load_extension('project')
|
||||||
require('telescope').load_extension('fzf')
|
require('telescope').load_extension('fzf')
|
||||||
|
|
||||||
|
-- wrap lines inside preview pane
|
||||||
|
vim.api.nvim_command('autocmd User TelescopePreviewerLoaded setlocal wrap')
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.octo_conf()
|
function M.octo_conf()
|
||||||
|
@ -1,403 +1,404 @@
|
|||||||
local fn,api = vim.fn,vim.api
|
local packer = require('modules.pack')
|
||||||
local packer_dir = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
|
||||||
|
|
||||||
if fn.empty(fn.glob(packer_dir)) > 0 then
|
-- This is recommended when using `luafile <afile>` a lot
|
||||||
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', packer_dir})
|
-- packer.reset()
|
||||||
api.nvim_command('packadd packer.nvim')
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Require since we use 'packer' as opt
|
return packer.startup(function(use)
|
||||||
api.nvim_command [[packadd packer.nvim]]
|
use {'wbthomason/packer.nvim', opt = true}
|
||||||
|
|
||||||
return require('packer').startup(
|
---------------------------------
|
||||||
function(use)
|
-- Plugins used by many others --
|
||||||
use {'wbthomason/packer.nvim', opt = true}
|
---------------------------------
|
||||||
|
use {'kyazdani42/nvim-web-devicons', module = 'nvim-web-devicons'}
|
||||||
|
use {'nvim-lua/plenary.nvim', module = 'plenary'}
|
||||||
|
use {'nvim-lua/popup.nvim', module = 'popup'}
|
||||||
|
|
||||||
---------------------------------
|
--------
|
||||||
-- Plugins used by many others --
|
-- UI --
|
||||||
---------------------------------
|
--------
|
||||||
use {'kyazdani42/nvim-web-devicons', module = 'nvim-web-devicons'}
|
local ui = require('modules.ui')
|
||||||
use {'nvim-lua/plenary.nvim', module = 'plenary'}
|
use {
|
||||||
use {'nvim-lua/popup.nvim', module = 'popup'}
|
'goolord/alpha-nvim',
|
||||||
|
event = 'VimEnter',
|
||||||
--------
|
config = ui.dashboard_conf
|
||||||
-- UI --
|
}
|
||||||
--------
|
use {
|
||||||
local ui = require('modules.ui')
|
'famiu/feline.nvim',
|
||||||
use {
|
wants = 'nvim-web-devicons',
|
||||||
'goolord/alpha-nvim',
|
config = ui.statusline_conf
|
||||||
event = 'VimEnter',
|
}
|
||||||
config = ui.dashboard_conf
|
use {
|
||||||
}
|
'akinsho/bufferline.nvim',
|
||||||
use {
|
event = {'BufRead', 'BufNewFile'},
|
||||||
'famiu/feline.nvim',
|
config = ui.bufferline_conf
|
||||||
wants = 'nvim-web-devicons',
|
}
|
||||||
config = ui.statusline_conf
|
use {
|
||||||
}
|
'kyazdani42/nvim-tree.lua',
|
||||||
use {
|
cmd = 'NvimTreeToggle',
|
||||||
'akinsho/bufferline.nvim',
|
setup = ui.nvimtree_conf,
|
||||||
event = {'BufRead', 'BufNewFile'},
|
-- FIX: when all the options are migrated to setup()
|
||||||
config = ui.bufferline_conf
|
config = function()
|
||||||
}
|
require('nvim-tree').setup {
|
||||||
use {
|
open_on_setup = false,
|
||||||
'kyazdani42/nvim-tree.lua',
|
auto_close = true,
|
||||||
cmd = 'NvimTreeToggle',
|
hijack_cursor = true,
|
||||||
setup = ui.nvimtree_conf,
|
update_cwd = true,
|
||||||
-- FIX: when all the options are migrated to setup()
|
lsp_diagnostics = true,
|
||||||
config = function()
|
view = {
|
||||||
require('nvim-tree').setup {
|
auto_resize = false
|
||||||
open_on_setup = false,
|
|
||||||
auto_close = true,
|
|
||||||
hijack_cursor = true,
|
|
||||||
update_cwd = true,
|
|
||||||
lsp_diagnostics = true,
|
|
||||||
view = {
|
|
||||||
auto_resize = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
end
|
}
|
||||||
}
|
end
|
||||||
use {
|
}
|
||||||
'folke/which-key.nvim',
|
use {
|
||||||
event = 'VimEnter',
|
'folke/which-key.nvim',
|
||||||
config = ui.whichkey_conf
|
event = 'VimEnter',
|
||||||
}
|
config = ui.whichkey_conf
|
||||||
use {
|
}
|
||||||
'lewis6991/gitsigns.nvim',
|
use {
|
||||||
event = {'BufRead', 'BufNewFile'},
|
'lewis6991/gitsigns.nvim',
|
||||||
wants = 'plenary.nvim',
|
event = {'BufRead', 'BufNewFile'},
|
||||||
config = ui.gitsigns_conf
|
wants = 'plenary.nvim',
|
||||||
}
|
config = ui.gitsigns_conf
|
||||||
|
}
|
||||||
|
|
||||||
------------
|
------------
|
||||||
-- Editor --
|
-- Editor --
|
||||||
------------
|
------------
|
||||||
local editor = require('modules.editor')
|
local editor = require('modules.editor')
|
||||||
use {
|
use {
|
||||||
'norcalli/nvim-colorizer.lua',
|
'norcalli/nvim-colorizer.lua',
|
||||||
cmd = 'ColorizerToggle',
|
cmd = 'ColorizerToggle',
|
||||||
config = editor.colorizer_conf
|
config = editor.colorizer_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'RRethy/vim-illuminate',
|
'RRethy/vim-illuminate',
|
||||||
event = {'BufReadPre', 'BufNewFile'}
|
event = {'BufReadPre', 'BufNewFile'}
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
after = 'nvim-treesitter',
|
after = 'nvim-treesitter',
|
||||||
config = editor.blankline_conf
|
config = editor.blankline_conf
|
||||||
}
|
}
|
||||||
use { -- TODO: config (lua -> fennel) + learn clojure, fennel, guile scheme
|
use { -- TODO: config (lua -> fennel) + learn clojure, fennel, guile scheme
|
||||||
'Olical/conjure',
|
'Olical/conjure',
|
||||||
ft = {'clojure', 'fennel', 'scheme'},
|
ft = {'clojure', 'fennel', 'scheme'},
|
||||||
requires = {{'Olical/aniseed', config = editor.aniseed_conf}}
|
requires = {{'Olical/aniseed', config = editor.aniseed_conf}}
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = ':TSUpdate',
|
run = ':TSUpdate',
|
||||||
event = 'BufRead',
|
event = 'BufRead',
|
||||||
config = editor.treesitter_conf
|
config = editor.treesitter_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'p00f/nvim-ts-rainbow',
|
'p00f/nvim-ts-rainbow',
|
||||||
after = 'nvim-treesitter',
|
after = 'nvim-treesitter',
|
||||||
-- Putting config into `treesitter_conf` doesn't work for some reason
|
-- Putting config into `treesitter_conf` doesn't work for some reason
|
||||||
config = editor.rainbow_conf
|
config = editor.rainbow_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'romgrk/nvim-treesitter-context',
|
'romgrk/nvim-treesitter-context',
|
||||||
after = 'nvim-treesitter'
|
after = 'nvim-treesitter'
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||||
after = 'nvim-treesitter'
|
after = 'nvim-treesitter'
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'andymass/vim-matchup',
|
'mizlan/iswap.nvim',
|
||||||
after = 'nvim-treesitter',
|
cmd = {'ISwapWith', 'ISwap'},
|
||||||
config = editor.matchup_conf
|
wants = 'nvim-treesitter',
|
||||||
}
|
config = editor.iswap_conf
|
||||||
use {
|
}
|
||||||
'machakann/vim-sandwich',
|
use {
|
||||||
keys = 's'
|
'andymass/vim-matchup',
|
||||||
}
|
after = 'nvim-treesitter',
|
||||||
use {
|
config = editor.matchup_conf
|
||||||
'phaazon/hop.nvim',
|
}
|
||||||
cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'},
|
use {
|
||||||
config = editor.hop_conf
|
'machakann/vim-sandwich',
|
||||||
}
|
keys = 's'
|
||||||
use {
|
}
|
||||||
'hrsh7th/vim-eft',
|
use {
|
||||||
event = {'BufRead', 'BufNewFile'},
|
'phaazon/hop.nvim',
|
||||||
setup = editor.eft_conf
|
cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'},
|
||||||
}
|
config = editor.hop_conf
|
||||||
use {
|
}
|
||||||
'junegunn/vim-easy-align',
|
use {
|
||||||
cmd = 'EasyAlign'
|
'hrsh7th/vim-eft',
|
||||||
}
|
event = {'BufRead', 'BufNewFile'},
|
||||||
use {
|
setup = editor.eft_conf
|
||||||
'terrortylor/nvim-comment',
|
}
|
||||||
keys = 'gc',
|
use {
|
||||||
config = editor.comment_conf
|
'junegunn/vim-easy-align',
|
||||||
}
|
cmd = 'EasyAlign'
|
||||||
use {
|
}
|
||||||
'editorconfig/editorconfig-vim',
|
use {
|
||||||
ft = {'go', 'rust', 'python', 'c', 'cpp', 'javascript', 'typescript', 'vim', 'zig'}
|
'terrortylor/nvim-comment',
|
||||||
}
|
keys = 'gc',
|
||||||
use { -- TODO: move to nvim-parinfer (lua)
|
config = editor.comment_conf
|
||||||
'eraserhd/parinfer-rust',
|
}
|
||||||
run = 'cargo build --release',
|
use {
|
||||||
ft = {'clojure', 'lisp', 'scheme', 'fennel'}
|
'editorconfig/editorconfig-vim',
|
||||||
}
|
ft = {'go', 'rust', 'python', 'c', 'cpp', 'javascript', 'typescript', 'vim', 'zig'}
|
||||||
use {
|
}
|
||||||
'ahmedkhalf/project.nvim',
|
use { -- TODO: move to nvim-parinfer (lua)
|
||||||
event = 'BufEnter',
|
'eraserhd/parinfer-rust',
|
||||||
config = editor.project_conf
|
run = 'cargo build --release',
|
||||||
}
|
ft = {'clojure', 'lisp', 'scheme', 'fennel'}
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'ahmedkhalf/project.nvim',
|
||||||
|
event = 'BufEnter',
|
||||||
|
config = editor.project_conf
|
||||||
|
}
|
||||||
|
|
||||||
---------
|
---------
|
||||||
-- LSP --
|
-- LSP --
|
||||||
---------
|
---------
|
||||||
local lsp = require('modules.lsp')
|
local lsp = require('modules.lsp')
|
||||||
use { -- TODO: scripts to install/update lsp servers
|
use { -- TODO: scripts to install/update lsp servers
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
event = 'BufReadPre',
|
event = 'BufReadPre',
|
||||||
wants = 'lsp_signature.nvim',
|
wants = 'lsp_signature.nvim',
|
||||||
requires = {{'ray-x/lsp_signature.nvim', opt = true}},
|
requires = {{'ray-x/lsp_signature.nvim', opt = true}},
|
||||||
config = lsp.lsp_conf
|
config = lsp.lsp_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'nanotee/sqls.nvim',
|
'nanotee/sqls.nvim',
|
||||||
ft = {'sql', 'mysql', 'plsql'},
|
ft = {'sql', 'mysql', 'plsql'},
|
||||||
wants = 'nvim-lspconfig',
|
wants = 'nvim-lspconfig',
|
||||||
config = lsp.sqls_conf
|
config = lsp.sqls_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'folke/trouble.nvim',
|
'folke/trouble.nvim',
|
||||||
cmd = {'Trouble', 'TroubleToggle', 'TroubleRefresh'},
|
cmd = {'Trouble', 'TroubleToggle', 'TroubleRefresh'},
|
||||||
config = lsp.trouble_conf
|
config = lsp.trouble_conf
|
||||||
}
|
}
|
||||||
-- use { -- FIX: conflict highlights with hop.nvim
|
-- use { -- FIX: conflict highlights with hop.nvim
|
||||||
-- 'folke/todo-comments.nvim',
|
-- 'folke/todo-comments.nvim',
|
||||||
-- wants = 'plenary.nvim',
|
-- wants = 'plenary.nvim',
|
||||||
-- event = 'BufRead',
|
-- event = 'BufRead',
|
||||||
-- config = lsp.comments_conf
|
-- config = lsp.comments_conf
|
||||||
-- }
|
-- }
|
||||||
use {
|
use {
|
||||||
'simrat39/symbols-outline.nvim',
|
'simrat39/symbols-outline.nvim',
|
||||||
cmd = {'SymbolsOutline', 'SymbolsOutlineOpen'},
|
cmd = {'SymbolsOutline', 'SymbolsOutlineOpen'},
|
||||||
setup = lsp.outline_conf
|
setup = lsp.outline_conf
|
||||||
}
|
}
|
||||||
use { -- TODO: scripts to install/update linters
|
use { -- TODO: scripts to install/update linters
|
||||||
'mfussenegger/nvim-lint',
|
'mfussenegger/nvim-lint',
|
||||||
event = 'BufRead',
|
event = 'BufRead',
|
||||||
config = lsp.lint_conf
|
config = lsp.lint_conf
|
||||||
}
|
}
|
||||||
use { -- TODO: config, scripts to install/update dap servers
|
use { -- TODO: config, scripts to install/update dap servers
|
||||||
'rcarriga/nvim-dap-ui',
|
'rcarriga/nvim-dap-ui',
|
||||||
event = 'BufReadPre',
|
event = 'BufReadPre',
|
||||||
wants = 'nvim-dap',
|
wants = 'nvim-dap',
|
||||||
requires = {{'mfussenegger/nvim-dap', config = lsp.dap_conf, opt = true}},
|
requires = {{'mfussenegger/nvim-dap', config = lsp.dap_conf, opt = true}},
|
||||||
config = lsp.dapui_conf
|
config = lsp.dapui_conf
|
||||||
}
|
}
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
-- Completion --
|
-- Completion --
|
||||||
----------------
|
----------------
|
||||||
local completion = require('modules.completion')
|
local completion = require('modules.completion')
|
||||||
use {
|
use {
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
event = 'InsertEnter',
|
event = 'InsertEnter',
|
||||||
wants = 'LuaSnip',
|
wants = 'LuaSnip',
|
||||||
requires = {{
|
requires = {{
|
||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
wants = 'friendly-snippets',
|
wants = 'friendly-snippets',
|
||||||
requires = {{'rafamadriz/friendly-snippets', opt = true}},
|
requires = {{'rafamadriz/friendly-snippets', opt = true}},
|
||||||
config = completion.snippets_conf,
|
config = completion.snippets_conf,
|
||||||
opt = true
|
opt = true
|
||||||
}},
|
}},
|
||||||
config = completion.cmp_conf
|
config = completion.cmp_conf
|
||||||
}
|
}
|
||||||
use {'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp'}
|
use {'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp'}
|
||||||
use {'hrsh7th/cmp-path', after = 'nvim-cmp'}
|
use {'hrsh7th/cmp-path', after = 'nvim-cmp'}
|
||||||
use {'hrsh7th/cmp-buffer', after = 'nvim-cmp'}
|
use {'hrsh7th/cmp-buffer', after = 'nvim-cmp'}
|
||||||
-- use {'hrsh7th/cmp-calc', after = 'nvim-cmp'}
|
-- use {'hrsh7th/cmp-calc', after = 'nvim-cmp'}
|
||||||
-- use {'f3fora/cmp-nuspell', after = 'nvim-cmp', rocks={'lua-nuspell'}}
|
-- use {'f3fora/cmp-nuspell', after = 'nvim-cmp', rocks={'lua-nuspell'}}
|
||||||
use {'f3fora/cmp-spell', after = 'nvim-cmp'}
|
use {'f3fora/cmp-spell', after = 'nvim-cmp'}
|
||||||
use {'hrsh7th/cmp-emoji', after = 'nvim-cmp'}
|
use {'hrsh7th/cmp-emoji', after = 'nvim-cmp'}
|
||||||
-- use {'ray-x/cmp-treesitter', after = {'nvim-cmp', 'nvim-treesitter'}}
|
-- use {'ray-x/cmp-treesitter', after = {'nvim-cmp', 'nvim-treesitter'}}
|
||||||
use {'hrsh7th/cmp-nvim-lsp', after = {'nvim-cmp', 'nvim-lspconfig'}}
|
use {'hrsh7th/cmp-nvim-lsp', after = {'nvim-cmp', 'nvim-lspconfig'}}
|
||||||
-- use {
|
-- use {
|
||||||
-- 'tzachar/cmp-tabnine',
|
-- 'tzachar/cmp-tabnine',
|
||||||
-- after = 'nvim-cmp',
|
-- after = 'nvim-cmp',
|
||||||
-- run = './install.sh',
|
-- run = './install.sh',
|
||||||
-- config = completion.tabnine_conf
|
-- config = completion.tabnine_conf
|
||||||
-- }
|
-- }
|
||||||
use {'kdheepak/cmp-latex-symbols', after = {'nvim-cmp', 'vimtex'}}
|
use {'kdheepak/cmp-latex-symbols', after = {'nvim-cmp', 'vimtex'}}
|
||||||
use {'andersevenrud/compe-tmux', after = 'nvim-cmp', branch = 'cmp'}
|
-- use {'andersevenrud/compe-tmux', after = 'nvim-cmp', branch = 'cmp'}
|
||||||
use {'PaterJason/cmp-conjure', after = {'conjure', 'nvim-cmp'}}
|
use {'PaterJason/cmp-conjure', after = {'conjure', 'nvim-cmp'}}
|
||||||
use {
|
use {
|
||||||
'windwp/nvim-autopairs',
|
'windwp/nvim-autopairs',
|
||||||
after = 'nvim-cmp',
|
after = 'nvim-cmp',
|
||||||
config = completion.autopairs_conf
|
config = completion.autopairs_conf
|
||||||
}
|
}
|
||||||
-- use {
|
-- use {
|
||||||
-- 'ms-jpq/coq_nvim',
|
-- 'ms-jpq/coq_nvim',
|
||||||
-- branch = 'coq',
|
-- branch = 'coq',
|
||||||
-- event = 'InsertEnter',
|
-- event = 'InsertEnter',
|
||||||
-- run = ':COQdeps',
|
-- run = ':COQdeps',
|
||||||
-- wants = 'coq.artifacts',
|
-- wants = 'coq.artifacts',
|
||||||
-- requires = {{'ms-jpq/coq.artifacts', branch = 'artifacts', opt = true}},
|
-- requires = {{'ms-jpq/coq.artifacts', branch = 'artifacts', opt = true}},
|
||||||
-- setup = completion.coq_conf
|
-- setup = completion.coq_conf
|
||||||
-- }
|
-- }
|
||||||
use {
|
use {
|
||||||
'windwp/nvim-ts-autotag',
|
'windwp/nvim-ts-autotag',
|
||||||
ft = {
|
ft = {
|
||||||
'html', 'javascript', 'javascriptreact', 'typescript',
|
'html', 'javascript', 'javascriptreact', 'typescript',
|
||||||
'typescriptreact', 'vue', 'svelte'
|
'typescriptreact', 'vue', 'svelte'
|
||||||
},
|
},
|
||||||
wants = 'nvim-treesitter',
|
wants = 'nvim-treesitter',
|
||||||
config = completion.autotag_conf
|
config = completion.autotag_conf
|
||||||
}
|
}
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
-- Tools --
|
-- Tools --
|
||||||
-----------
|
-----------
|
||||||
local tools = require('modules.tools')
|
local tools = require('modules.tools')
|
||||||
use { -- TODO: watch out for fzf-lua
|
use { -- TODO: watch out for fzf-lua
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
cmd = 'Telescope',
|
cmd = 'Telescope',
|
||||||
wants = {
|
wants = {
|
||||||
'popup.nvim',
|
'popup.nvim',
|
||||||
'plenary.nvim',
|
'plenary.nvim',
|
||||||
'telescope-symbols.nvim',
|
'telescope-symbols.nvim',
|
||||||
'telescope-project.nvim',
|
'telescope-project.nvim',
|
||||||
'telescope-fzf-native.nvim'
|
'telescope-fzf-native.nvim'
|
||||||
},
|
},
|
||||||
requires = {
|
requires = {
|
||||||
{'nvim-telescope/telescope-symbols.nvim', opt = true},
|
{'nvim-telescope/telescope-symbols.nvim', opt = true},
|
||||||
{'nvim-telescope/telescope-project.nvim', opt = true},
|
{'nvim-telescope/telescope-project.nvim', opt = true},
|
||||||
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = true}
|
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = true}
|
||||||
},
|
},
|
||||||
config = tools.telescope_conf
|
config = tools.telescope_conf
|
||||||
}
|
}
|
||||||
use { -- TODO: colors + config
|
use { -- TODO: colors + config
|
||||||
'pwntester/octo.nvim',
|
'pwntester/octo.nvim',
|
||||||
cmd = 'Octo',
|
cmd = 'Octo',
|
||||||
wants = 'telescope.nvim',
|
wants = 'telescope.nvim',
|
||||||
config = tools.octo_conf
|
config = tools.octo_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'TimUntersberger/neogit',
|
'TimUntersberger/neogit',
|
||||||
cmd = 'Neogit',
|
cmd = 'Neogit',
|
||||||
wants = {'diffview.nvim', 'plenary.nvim'},
|
wants = {'diffview.nvim', 'plenary.nvim'},
|
||||||
requires = {{
|
requires = {{
|
||||||
'sindrets/diffview.nvim',
|
'sindrets/diffview.nvim',
|
||||||
config = tools.diffview_conf,
|
config = tools.diffview_conf,
|
||||||
opt = true
|
opt = true
|
||||||
}},
|
}},
|
||||||
config = tools.neogit_conf
|
config = tools.neogit_conf
|
||||||
}
|
}
|
||||||
use { -- TODO: replace with code_runner.nvim
|
use { -- TODO: replace with code_runner.nvim
|
||||||
'skywind3000/asynctasks.vim',
|
'skywind3000/asynctasks.vim',
|
||||||
cmd = {
|
cmd = {
|
||||||
'AsyncTask',
|
'AsyncTask',
|
||||||
'AsyncTaskEdit',
|
'AsyncTaskEdit',
|
||||||
'AsyncTaskList',
|
'AsyncTaskList',
|
||||||
'AsyncTaskMacro'
|
'AsyncTaskMacro'
|
||||||
},
|
},
|
||||||
wants = 'asyncrun.vim',
|
wants = 'asyncrun.vim',
|
||||||
requires = {{
|
requires = {{
|
||||||
'skywind3000/asyncrun.vim',
|
'skywind3000/asyncrun.vim',
|
||||||
setup = tools.asynctasks_conf,
|
setup = tools.asynctasks_conf,
|
||||||
opt = true
|
opt = true
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'iamcco/markdown-preview.nvim',
|
'iamcco/markdown-preview.nvim',
|
||||||
run = 'cd app && yarn install',
|
run = 'cd app && yarn install',
|
||||||
ft = {'markdown', 'rmd'},
|
ft = {'markdown', 'rmd'},
|
||||||
config = tools.markdown_preview_conf
|
config = tools.markdown_preview_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'turbio/bracey.vim',
|
'turbio/bracey.vim',
|
||||||
run = 'npm install --prefix server',
|
run = 'npm install --prefix server',
|
||||||
cmd = 'Bracey'
|
cmd = 'Bracey'
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'folke/zen-mode.nvim',
|
'folke/zen-mode.nvim',
|
||||||
cmd = 'ZenMode',
|
cmd = 'ZenMode',
|
||||||
wants = 'twilight.nvim',
|
wants = 'twilight.nvim',
|
||||||
requires = {{'folke/twilight.nvim', opt = true}},
|
requires = {{'folke/twilight.nvim', opt = true}},
|
||||||
config = tools.zenmode_conf
|
config = tools.zenmode_conf
|
||||||
}
|
}
|
||||||
use { -- shouldn't be lazy-loaded (global bindings don't work)
|
use { -- shouldn't be lazy-loaded (global bindings don't work)
|
||||||
'kristijanhusak/orgmode.nvim',
|
'kristijanhusak/orgmode.nvim',
|
||||||
ft = 'org',
|
ft = 'org',
|
||||||
config = tools.orgmode_conf
|
config = tools.orgmode_conf
|
||||||
}
|
}
|
||||||
use { -- TODO: config
|
use { -- TODO: config
|
||||||
'lervag/vimtex',
|
'lervag/vimtex',
|
||||||
ft = 'tex',
|
ft = 'tex',
|
||||||
setup = tools.vimtext_conf
|
setup = tools.vimtext_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'windwp/nvim-spectre',
|
'windwp/nvim-spectre',
|
||||||
event = {'BufRead', 'BufNewFile'},
|
event = {'BufRead', 'BufNewFile'},
|
||||||
wants = 'plenary.nvim',
|
wants = 'plenary.nvim',
|
||||||
config = tools.spectre_conf
|
config = tools.spectre_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'echuraev/translate-shell.vim',
|
'echuraev/translate-shell.vim',
|
||||||
cmd = {'Trans', 'TransSelectDirection'},
|
cmd = {'Trans', 'TransSelectDirection'},
|
||||||
config = tools.translate_conf
|
config = tools.translate_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'mbbill/undotree',
|
'mbbill/undotree',
|
||||||
cmd = 'UndotreeToggle',
|
cmd = 'UndotreeToggle',
|
||||||
setup = tools.undotree_conf
|
setup = tools.undotree_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'akinsho/toggleterm.nvim',
|
'akinsho/toggleterm.nvim',
|
||||||
cmd = 'ToggleTerm',
|
cmd = 'ToggleTerm',
|
||||||
config = tools.toggleterm_conf
|
config = tools.toggleterm_conf
|
||||||
}
|
}
|
||||||
-- use {
|
-- use {
|
||||||
-- 'gelguy/wilder.nvim',
|
-- 'gelguy/wilder.nvim',
|
||||||
-- run = ':UpdateRemotePlugins',
|
-- run = ':UpdateRemotePlugins',
|
||||||
-- event = 'CmdlineEnter',
|
-- event = 'CmdlineEnter',
|
||||||
-- config = tools.wilder_conf
|
-- config = tools.wilder_conf
|
||||||
-- }
|
-- }
|
||||||
use {
|
use {
|
||||||
'karb94/neoscroll.nvim',
|
'karb94/neoscroll.nvim',
|
||||||
event = 'WinScrolled',
|
event = 'WinScrolled',
|
||||||
config = tools.neoscroll_conf
|
config = tools.neoscroll_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'michaelb/sniprun',
|
'michaelb/sniprun',
|
||||||
run = 'bash ./install.sh 1',
|
run = 'bash ./install.sh 1',
|
||||||
cmd = 'SnipRun',
|
cmd = 'SnipRun',
|
||||||
config = tools.sniprun_conf
|
config = tools.sniprun_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'NTBBloodbath/rest.nvim',
|
'NTBBloodbath/rest.nvim',
|
||||||
keys = {'<Plug>RestNvim', '<Plug>RestNvimPreview', '<Plug>RestNvimLast'},
|
keys = {'<Plug>RestNvim', '<Plug>RestNvimPreview', '<Plug>RestNvimLast'},
|
||||||
wants = {'plenary.nvim', 'nvim-treesitter'},
|
wants = {'plenary.nvim', 'nvim-treesitter'},
|
||||||
run = ':TSInstall http',
|
run = ':TSInstall http',
|
||||||
config = tools.rest_conf
|
config = tools.rest_conf
|
||||||
}
|
}
|
||||||
use { -- TODO: move to formater.nvim
|
use { -- TODO: move to formater.nvim
|
||||||
'sbdchd/neoformat',
|
'sbdchd/neoformat',
|
||||||
cmd = 'Neoformat'
|
cmd = 'Neoformat'
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'folke/persistence.nvim',
|
'folke/persistence.nvim',
|
||||||
event = 'BufEnter',
|
event = 'BufEnter',
|
||||||
config = tools.session_conf
|
config = tools.session_conf
|
||||||
}
|
}
|
||||||
-- use {'dstein64/vim-startuptime', cmd = 'StartupTime'} -- Just for benchmarking
|
use {'dstein64/vim-startuptime', cmd = 'StartupTime'} -- Just for benchmarking
|
||||||
|
|
||||||
-- TODO: dial.nvim, rust-tools.nvim, crates.nvim, go.nvim, clojure-vim/*,
|
-- TODO: dial.nvim, rust-tools.nvim, crates.nvim, go.nvim, clojure-vim/*,
|
||||||
-- nvim-bqf, nvim-comment-frame, nvim-revJ.lua
|
-- nvim-bqf, nvim-comment-frame, nvim-revJ.lua
|
||||||
end
|
|
||||||
)
|
-- Install plugins if missing
|
||||||
|
packer.install()
|
||||||
|
end)
|
||||||
|
104
home/.local/bin/doasedit
Executable file
104
home/.local/bin/doasedit
Executable file
@ -0,0 +1,104 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# doasedit
|
||||||
|
# Link: git.io/doasedit
|
||||||
|
|
||||||
|
# Dependencies: opendoas <https://github.com/Duncaen/OpenDoas> or doas <https://cvsweb.openbsd.org/src/usr.bin/doas/>
|
||||||
|
|
||||||
|
# Author: Stanislav <git.io/monesonn>
|
||||||
|
# Description: doas equivalent to sudoedit.
|
||||||
|
# Licence: ISC
|
||||||
|
# Contribution: If you have some ideas, how to improve this script, feel free to make pull request or write an issue.
|
||||||
|
|
||||||
|
# Tips: Use this script with enabled persistence in doas.conf file, like:
|
||||||
|
#
|
||||||
|
# `permit persist :wheel`
|
||||||
|
#
|
||||||
|
# Also make sure that your doas.conf is owned by root with read-only permissions, like:
|
||||||
|
#
|
||||||
|
# # chown -c root:root /path/to/doas.conf && chmod 0400 path/to/doas.conf
|
||||||
|
#
|
||||||
|
|
||||||
|
# Throw error message.
|
||||||
|
err() {
|
||||||
|
printf "%s%s\n" "doasedit: " "${1}" >&2
|
||||||
|
exit "${2}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Catch arguments.
|
||||||
|
if [ -n "${2}" ]; then
|
||||||
|
err "expected only one argument" 1
|
||||||
|
elif [ -z "${1}" ]; then
|
||||||
|
err "no file path provided" 2
|
||||||
|
elif [ "$(id -u)" -eq 0 ]; then
|
||||||
|
err "doasedit: cannot be run as root" 3
|
||||||
|
elif [ -d "${1}" ]; then
|
||||||
|
err "${1} is a directory" 4
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Safe shell options.
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# Reset doas password promt. If you want, feel free to comment this.
|
||||||
|
case "$(uname -s | tr '[:upper:]' '[:lower:]')" in
|
||||||
|
linux) doas -L ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Absolute path to the source file (file for editing).
|
||||||
|
src="$(doas readlink -f "${1}")"
|
||||||
|
|
||||||
|
# Filename for the source file.
|
||||||
|
filename="${src##*/}"
|
||||||
|
|
||||||
|
# If filename have suffix then also use it for a temporary file.
|
||||||
|
# It's kinda useful for editors, that have plugins or something else for certain file extensions.
|
||||||
|
[ "$filename" = "${filename##*.}" ] && filename_ext="" || filename_ext=".${filename##*.}"
|
||||||
|
|
||||||
|
# Be sure /tmp as tmp directory by setting TMPDIR env.
|
||||||
|
export TMPDIR=/tmp
|
||||||
|
|
||||||
|
# Create a temporary directory.
|
||||||
|
tmp_d=$(mktemp -d)
|
||||||
|
|
||||||
|
# Create a temporary file for the source file in a temporary directory.
|
||||||
|
tmp_f="${tmp_d}/${filename}$(xxd -l4 -ps /dev/urandom)${filename_ext}"
|
||||||
|
|
||||||
|
# File writeability condition.
|
||||||
|
if [ -w "$src" ]; then
|
||||||
|
err "$filename: editing files in a writable directory is not permitted" 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Other conditions: if file exist, readable, etc.
|
||||||
|
if [ -f "${src}" ] && [ ! -r "${src}" ]; then
|
||||||
|
doas cat "${src}" > "${tmp_f}" || err "the file is not readable" 6
|
||||||
|
elif [ -r "${src}" ]; then
|
||||||
|
cat "${src}" > "${tmp_f}" || err "cannot transfer to content of the file to temporary one" 7
|
||||||
|
elif [ ! -f "${src}" ]; then
|
||||||
|
# Grant .rw-r--r-- permission for newly created files by default owned by root.
|
||||||
|
:> "${tmp_f}" && doas chmod -R 0644 "${tmp_f}" || err "cannot create new file" 8
|
||||||
|
else
|
||||||
|
err "unexpected script behaviour" 9
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create copy of the temporary file.
|
||||||
|
tmp_cf="${tmp_d}/${filename}$(xxd -l4 -ps /dev/urandom).copy"
|
||||||
|
|
||||||
|
# Hooks for recursive removing of a temporary directory.
|
||||||
|
trap 'rm -rf ${tmp_d}' EXIT HUP QUIT TERM INT ABRT
|
||||||
|
|
||||||
|
# Move the contents of a temporary file to its copy for later comparison.
|
||||||
|
cat "${tmp_f}" > "${tmp_cf}"
|
||||||
|
|
||||||
|
# Editing the file by the user using the default editor, if not specified, the vi is used.
|
||||||
|
${EDITOR:-vi} "${tmp_f}"
|
||||||
|
|
||||||
|
# Compare the temporary file and the temporary copy.
|
||||||
|
if cmp -s "${tmp_f}" "${tmp_cf}"; then
|
||||||
|
printf "%s\n" "doasedit: $filename unchanged"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
# Replace the source file with temporary, repeats three times if it fails.
|
||||||
|
for doas_tries in $(seq 1 3); do doas cp -f "${tmp_f}" "${src}" && break; done
|
||||||
|
printf "%s\n" "doasedit: $filename changes are accepted"
|
||||||
|
exit 0
|
||||||
|
fi
|
@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ "$1" = "-h" ]; then
|
|
||||||
echo "Usage: pancomp [input_format] [input_file] [output_format] [output_file]"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $# -ne 4 ]; then
|
|
||||||
echo "Bruh, I need 4 arguments."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
pandoc \
|
|
||||||
--pdf-engine=xelatex \
|
|
||||||
-V 'mainfont:Iosevka Etoile' \
|
|
||||||
-V 'sansfont:Iosevka Aile' \
|
|
||||||
-V 'monofont:Iosevka' \
|
|
||||||
-V 'geometry:margin=1in' \
|
|
||||||
-f "$1" -t "$3" \
|
|
||||||
-o "$4" "$2"
|
|
Loading…
Reference in New Issue
Block a user