local M = {} function M.telescope_conf() require('telescope').setup { defaults = { prompt_prefix = '  ', selection_caret = ' ', set_env = {['COLORTERM'] = 'truecolor'}, sorting_strategy = 'ascending', layout_strategy = 'horizontal', layout_config = { horizontal = { prompt_position = 'top', preview_width = 0.6 }, 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' }, file_browser = { hidden = true } }, extensions = { project = { base_dirs = {{'~/Code', max_depth = 4}}, hidden_files = true }, fzf = { fuzzy = true, override_generic_sorter = false, override_file_sorter = true, case_mode = 'smart_case' } } } require('telescope').load_extension('projects') require('telescope').load_extension('project') require('telescope').load_extension('fzf') end function M.octo_conf() require('octo').setup() end function M.neogit_conf() require('neogit').setup { integrations = { diffview = true } } end function M.diffview_conf() require('diffview').setup {diff_binaries = true} end function M.asynctasks_conf() -- vim.g.asyncrun_open = 8 -- when using quickfix window (output=terminal is preferable) vim.g.asyncrun_rootmarks = {'.git', '.svn', '.root', '.hg', '.projectile'} vim.g.asynctasks_term_pos = 'bottom' vim.g.asynctasks_term_rows = 10 vim.g.asynctasks_config_name = 'tasks.ini' vim.g.asynctasks_template = '~/.config/nvim/asynctasks.ini' end function M.markdown_preview_conf() vim.g.mkdp_refresh_slow = 1 vim.g.mkdp_filetypes = { 'markdown', 'pandoc.markdown', 'rmd' } -- vim.g.mkdp_browser = 'qutebrowser' -- vim.g.mkdp_page_title = '「${name}」' -- vim.g.mkdp_echo_preview_url = 1 end function M.rest_conf() require('rest-nvim').setup({ -- Open request results in a horizontal split result_split_horizontal = false, -- Skip SSL verification, useful for unknown certificates skip_ssl_verification = false, -- Highlight request on run highlight = { enabled = true, timeout = 150, }, -- Jump to request line on run jump_to_request = false, }) 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.api.nvim_command('TSContextDisable') vim.api.nvim_command('IndentBlanklineDisable') end, on_close = function() vim.api.nvim_command('TSContextEnable') -- vim.api.nvim_command('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.spectre_conf() require('spectre').setup() 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.undotree_conf() vim.g.undotree_WindowLayout = 2 vim.g.undotree_SplitWidth = 30 vim.g.undotree_DiffpaneHeight = 10 vim.g.undotree_SetFocusWhenToggle = 1 vim.g.undotree_RelativeTimestamp = 1 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.api.nvim_command [[ 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.api.nvim_command [[ -- 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.api.nvim_command [[ -- 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 function M.sniprun_conf() local c = require('colors.' .. vim.g.global_theme).colors require('sniprun').setup { display = { 'Classic', --# display results in the command-line area 'VirtualTextOk', --# display ok results as virtual text (multiline is shortened) -- 'VirtualTextErr', --# display error results as virtual text -- 'TempFloatingWindow', --# display results in a floating window -- 'LongTempFloatingWindow', --# same as above, but only long results. To use with VirtualText__ -- 'Terminal', --# display results in a vertical split -- 'NvimNotify', --# display with the nvim-notify plugin -- 'Api' --# return output to a programming interface }, show_no_output = { 'Classic', 'TempFloatingWindow' --# implies LongTempFloatingWindow, which has no effect on its own }, snipruncolors = { SniprunVirtualTextOk = {bg = c.cyan, fg = c.black}, SniprunFloatingWinOk = {fg = c.cyan}, SniprunVirtualTextErr = {bg = c.orange, fg = c.black}, SniprunFloatingWinErr = {fg = c.orange} }, inline_messages = 0, --# inline_message (0/1) is a one-line way to display messages --# to workaround sniprun not being able to display anything borders = 'single' --# display borders around floating windows --# possible values are 'none', 'single', 'double', or 'shadow' } end function M.session_conf() require('persistence').setup { dir = vim.fn.expand(vim.fn.stdpath('data') .. '/sessions/'), options = {'buffers', 'curdir', 'tabpages', 'winsize'} } end return M