FollieHiyuki-dotfiles/home/.config/nvim/lua/modules/tools.lua

221 lines
6.4 KiB
Lua
Raw Normal View History

local M = {}
function M.telescope_conf()
require('telescope').setup {
defaults = {
prompt_prefix = '',
selection_caret = '',
set_env = {['COLORTERM'] = 'truecolor'},
layout_strategy = 'horizontal',
layout_config = {
horizontal = {
preview_width = 0.6
},
-- prompt_position = 'top',
width = 0.8,
height = 0.8
},
file_ignore_patterns = {'.git', '.svn', '.hg', 'node_modules'}
},
pickers = {
find_files = {
hidden = true,
follow = true
},
grep_string = {
opts = '--hidden'
}
},
extensions = {
project = {
base_dirs = {{'~/Code', max_depth = 2}}
},
fzf = {
fuzzy = true,
override_generic_sorter = false,
override_file_sorter = true,
case_mode = 'smart_case'
}
}
}
require('telescope').load_extension('project')
require('telescope').load_extension('fzf')
end
function M.nnn_conf()
require('nnn').setup {
set_default_mappings = false,
session = 'global',
layout = {
window = {width = 0.8, height = 0.8, highlight = 'Debug'},
},
command = 'nnn -HUdex',
action = {
['<c-t>'] = 'tab split',
['<c-h>'] = 'split',
['<c-v>'] = 'vsplit'
}
}
end
function M.octo_conf()
require('octo').setup()
end
function M.neogit_conf()
require('neogit').setup {
integrations = {
diffview = true
}
}
end
function M.markdown_preview_conf()
vim.g.mkdp_refresh_slow = 1
vim.g.mkdp_filetypes = {
'markdown',
'pandoc.markdown',
'rmd'
}
-- vim.g.mkdp_page_title = '「${name}」'
-- vim.g.mkdp_echo_preview_url = 1
end
function M.zenmode_conf()
require('zen-mode').setup {
window = {
options = {
signcolumn = 'no',
number = false,
relativenumber = false,
cursorline = false,
cursorcolumn = false,
foldcolumn = '0'
}
},
on_open = function()
vim.cmd('TSContextDisable')
vim.cmd('IndentBlanklineDisable')
end,
on_close = function()
vim.cmd('TSContextEnable')
-- vim.cmd('IndentBlanklineEnable')
end
}
end
function M.orgmode_conf()
local c = require('colors.' .. vim.g.global_theme).colors
require('orgmode').setup({
-- General settings
org_agenda_files = {'~/Documents/Org/agenda/*'},
org_default_notes_file = '~/Documents/Org/notes.org',
org_todo_keywords = {
'TODO', 'PROJ', 'LOOP', 'STRT', 'WAIT', 'HOLD', 'IDEA', 'DONE', 'KILL',
'[ ]', '[-]', '[X]' , '|', 'OKAY', 'YES', 'NO'
},
org_todo_keyword_faces = {
TODO = ':foreground ' .. c.green .. ' :weight bold',
PROJ = ':foreground ' .. c.grey_bright .. ' :weight bold :slant italic',
LOOP = ':foreground ' .. c.green .. ' :weight bold :underline on',
STRT = ':foreground ' .. c.blue .. ' :weight bold',
WAIT = ':foreground ' .. c.yellow .. ' :weight bold',
HOLD = ':foreground ' .. c.yellow .. ' :weight bold :slant italic',
IDEA = ':foreground ' .. c.green .. ' :weight bold :slant italic',
DONE = ':foreground ' .. c.grey2 .. ' :weight bold',
KILL = ':foreground ' .. c.red .. ' :weight bold',
OKAY = ':foreground ' .. c.grey1 .. ' :weight bold :slant italic',
YES = ':foreground ' .. c.grey1 .. ' :weight bold :underline on',
NO = ':foreground ' .. c.red .. ' :weight bold :underline on'
},
org_hide_leading_stars = true,
org_highlight_latex_and_related = 'entities',
-- Agenda settings
org_deadline_warning_days = 7,
org_agenda_span = 'week',
org_agenda_start_on_weekday = 7, -- Start a week in Sunday
org_agenda_min_height = 15,
-- Tags settings
org_use_tag_inheritance = false
})
end
function M.vimtex_conf()
end
function M.translate_conf()
vim.g.trans_join_lines = 1
vim.g.trans_win_height = 15
vim.g.trans_default_direction = ':ja'
vim.g.trans_directions_list = {
{'', 'en'},
{'', 'ja'},
{'', 'de'},
{'', 'ru'},
{'', 'fr'},
{'', 'nl'},
{'', 'es'},
{'', 'zh-CN'},
{'', 'zh-TW'}
}
end
function M.toggleterm_conf()
require('toggleterm').setup {
shade_terminals = false,
float_opts = {
border = 'curved',
-- width = 80,
-- height = 80,
winblend = 3,
highlights = {
border = 'Normal',
background = 'Normal'
}
}
}
end
function M.wilder_conf()
vim.cmd [[ call wilder#setup({'modes': [':', '/', '?']}) ]]
-- Doesn't work yet. Bugs in Neovim (see neovim/neovim#14809 and gelguy/wilder.nvim#53)
-- so can't do multi-line config inside vim.cmd [[ ]] with \
-- vim.cmd [[
-- call wilder#set_option('renderer', wilder#renderer_mux({
-- \ ':': wilder#popupmenu_renderer({
-- \ 'highlighter': wilder#basic_highlighter(),
-- \ 'left': wilder#popupmenu_devicons(),
-- \ 'right': [' ', wilder#popupmenu_scrollbar()]
-- \ }),
-- \ '/': wilder#wildmenu_renderer({
-- \ 'highlighter': wilder#basic_highlighter(),
-- \ 'separator': ' · ',
-- \ 'right': [' ', wilder#wildmenu_index()]
-- \ })
-- \ }))
-- ]]
-- vim.cmd [[
-- call wilder#set_option('pipeline', [
-- \ wilder#branch(
-- \ wilder#python_file_finder_pipeline({
-- \ 'file_command': ['fd', '--type', 'f', '--follow', '--hidden', '--exclude', '.git'],
-- \ 'dir_command': ['fd', '--type', 'd', '--follow', '--hidden', '--exclude', '.git']
-- \ }),
-- \ wilder#cmdline_pipeline({'language': 'python'}),
-- \ wilder#python_search_pipeline()
-- \ )
-- \ ])
-- ]]
end
function M.neoscroll_conf()
require('neoscroll').setup()
end
return M