-- ┌─────────────────────────────────────┐ -- │ ▜ ▐ ▐ ▗ │ -- │▛▀▖▐ ▌ ▌▞▀▌▗▖▖▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ -- │▙▄▘▐ ▌ ▌▚▄▌▘▝ ▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ -- │▌ ▘▝▀▘▗▄▘ ▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ -- └─────────────────────────────────────┘ local g = vim.g -- global for let options local opt = vim.opt -- convenient :set local cmd = vim.cmd -- vim commands -- vimwiki {{{ -- g.vimwiki_list = { { path = '/home/yigit/nextcloud/personal_wiki/text', path_html = '/home/yigit/nextcloud/personal_wiki/html', auto_generate_tags = 1, automatic_nested_syntaxes = 1, template_path = '/home/yigit/nextcloud/personal_wiki/templates', template_default = 'default_template', template_ext = '.html', auto_export = 1, auto_tags = 1 } } g.vimwiki_global_ext = 0 g.vimwiki_hl_headers = 1 -- }}} vimwiki -- -- lualine {{{ -- local function lualine_spell() if vim.wo.spell then return "spell" else return end end -- Grinds vim to a halt local function lualine_tex_wordcount() return vim.fn['vimtex#misc#wordcount']() .. " ‽" end local conditions = { spell_on = function () return vim.wo.spell end, filetype_is_tex = function() return vim.bo.filetype == "tex" end } require'lualine'.setup { options = { icons_enabled = true, theme = 'rose-pine', section_separators = { left = '', right = '' }, component_separators = { left = '', right = '' }, }, sections = { lualine_a = {{'mode', fmt = string.lower}}, lualine_b = {'branch', 'diff', { lualine_spell, cond = conditions.spell_on, }}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, lualine_z = { 'location', { 'diagnostics', sources = {'nvim_lsp'}, sections = {'error', 'warn', 'info', 'hint'}, symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} } } }, inactive_sections = { lualine_a = {}, lualine_b = {}, lualine_c = {'filename'}, lualine_x = {}, lualine_y = {}, lualine_z = {} }, tabline = { lualine_a = {'buffers'}, lualine_b = {}, lualine_c = {}, lualine_x = {}, lualine_y = {}, lualine_z = {'tabs'} }, extensions = {} } -- }}} lualine -- -- cutlass suite {{{ -- -- cutlass/yoink/subverse suite g.yoinkIncludeDeleteOperations = 1 -- fix the Target STRING not available g.clipboard = { name = 'xsel_override', copy = { ['+'] = 'xsel --input --clipboard', ['*'] = 'xsel --input --primary', }, paste = { ['+'] = 'xsel --output --clipboard', ['*'] = 'xsel --output --primary', }, cache_enabled = 1, } -- }}} cutlass suite -- -- UltiSnips {{{ -- g.UltiSnipsEditSplit = "vertical" -- ctrl + l expands the snippet, c + j/k navigates placeholders g.UltiSnipsExpandTrigger = "" g.UltiSnipsEnableSnipMate = "1" g.UltiSnipsSnippetDirectories = {"my_snippets", "UltiSnips"} -- }}} UltiSnips -- -- vimtex {{{ -- g.vimtex_view_method = 'zathura' g.vimtex_quickfix_mode = 0 -- }}} vimtex -- -- filetype.nvim {{{ -- require('filetype').setup({ overrides = { literal = { PKGBUILD = 'PKGBUILD', }, } }) -- }}} filetype.nvim -- -- ledger {{{ -- g.ledger_maxwidth = 80 g.ledger_fillstring = ' -' -- }}} ledger -- -- devicons {{{ -- require'nvim-web-devicons'.setup { override = { wiki = { icon = "", color = "#D7827E", name = "vimwiki" }, rem = { icon = "", color = "#B4637A", name = "remind" }, mail = { icon = "", color = "#907AA9", name = "mail" }, }; default = true } -- }}} devicons -- -- vim-slime {{{ -- g.slime_target = "tmux" g.slime_paste_file = "$HOME/.slime_paste" g.slime_default_config = {socket_name = vim.call("get", vim.call("split", vim.env.TMUX, ','), "0"), target_pane = "{last}"} -- }}} vim-slime -- -- gutentags {{{ -- g.gutentags_enabled = 1 g.gutentags_add_default_project_roots = 0 g.gutentags_project_root = {'Makefile', '.git'} g.gutentags_exclude_filetypes = {'gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git'} g.gutentags_generate_on_new = 1 g.gutentags_generate_on_missing = 1 g.gutentags_generate_on_write = 1 g.gutentags_generate_on_empty_buffer = 0 g.gutentags_ctags_exclude = { '*.git', '*.svn', '*.hg', 'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components', '*-lock.json', '*.lock', '*.min.*', '*.bak', '*.zip', '*.pyc', '*.class', '*.sln', '*.csproj', '*.csproj.user', '*.tmp', '*.cache', '*.vscode', '*.pdb', '*.exe', '*.dll', '*.bin', '*.mp3', '*.ogg', '*.flac', '*.swp', '*.swo', '.DS_Store', '*.plist', '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg', '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2', '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls', } -- }}} gutentags -- -- telescope {{{ -- require('telescope').setup { extensions = { fzf = { fuzzy = true, -- false will only do exact matching override_generic_sorter = true, -- override the generic sorter override_file_sorter = true, -- override the file sorter case_mode = "smart_case", -- or "ignore_case" or "respect_case" -- the default case_mode is "smart_case" } } } require('telescope').load_extension('fzf') -- }}} telescope -- -- dashboard {{{ -- g.dashboard_default_executive = 'telescope' g.dashboard_preview_command = 'cat' g.dashboard_preview_file = '~/.config/nvim/neovim.cat' g.dashboard_preview_file_height = 13 g.dashboard_preview_file_width = 90 g.dashboard_footer_icon = '💃 ' g.dashboard_custom_shortcut = { last_session = ' s l', find_history = ' f h', find_file = ' f f', new_file = ' c n', change_colorscheme = ' t c', find_word = ' f a', book_marks = ' f b', } -- }}} dashboard -- -- treesitter {{{ -- require 'nvim-treesitter.configs'.setup { ensure_installed = "maintained", highlight = { enable = true, additional_vim_regex_highlighting = false, }, incremental_selection = { enable = true, keymaps = { init_selection = "gnn", node_incremental = "grn", scope_incremental = "grc", node_decremental = "grm", }, }, indent = { enable = true } } -- }}} treesitter -- -- nvim-cmp {{{ -- local cmp = require'cmp' cmp.setup({ snippet = { expand = function(args) vim.fn["UltiSnips#Anon"](args.body) end, }, mapping = { [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ select = true }), }, sources = { { name = 'nvim_lsp' }, { name = 'ultisnips' }, { name = 'buffer' }, } }) -- }}} nvim-cmp -- -- nvim-lsp {{{ -- local nvim_lsp = require('lspconfig') local on_attach = function(client, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end -- Enable completion triggered by buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') -- Mappings. local opts = { noremap=true, silent=true } -- See `:help vim.lsp.*` for documentation on any of the below functions buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) buf_set_keymap('n', 'vh', 'lua vim.lsp.buf.hover()', opts) buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) buf_set_keymap('n', 'gh', 'lua vim.lsp.buf.signature_help()', opts) buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) buf_set_keymap('n', 'wd', 'lua vim.lsp.buf.remove_workspace_folder()', opts) buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) buf_set_keymap('n', 'd', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) end local servers = { 'rust_analyzer', 'jedi_language_server', 'texlab', 'clangd' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, flags = { debounce_text_changes = 150, }, capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) } end nvim_lsp['efm'].setup{ on_attach = on_attach, filetypes = { 'sh' }, capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) } -- }}} nvim-lsp -- -- vista {{{ -- g.vista_icon_indent = {"╰ ", "│ "} -- }}} vista -- -- indent-blankline {{{ -- vim.opt.list = true require("indent_blankline").setup { show_current_context = true, char = "┊", buftype_exclude = {"terminal"}, filetype_exclude = {"dashboard", "help", "ledger", "man"} } -- }}} indent-blankline -- -- nvim-autopairs {{{ -- require('nvim-autopairs').setup({ disable_filetype = { "TelescopePrompt" }, }) local cmp_autopairs = require('nvim-autopairs.completion.cmp') local cmp = require('cmp') cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done()) local Rule = require('nvim-autopairs.rule') local npairs = require('nvim-autopairs') npairs.add_rule(Rule('%"','%"',"remind")) -- }}} nvim-autopairs -- -- nvim-tree {{{ -- require'nvim-tree'.setup { disable_netrw = true, hijack_netrw = true, open_on_setup = false, ignore_ft_on_setup = {}, -- closes neovim automatically when the tree is the last **WINDOW** in the view auto_close = true, open_on_tab = false, -- hijacks new directory buffers when they are opened. update_to_buf_dir = { -- enable the feature enable = true, -- allow to open the tree if it was previously closed auto_open = true, }, -- hijack the cursor in the tree to put it at the start of the filename hijack_cursor = false, -- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually) update_cwd = true, -- show lsp diagnostics in the signcolumn diagnostics = { enable = false, icons = { hint = "❔", info = "❕", warning = "❗", error = "❌", } }, -- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file update_focused_file = { -- enables the feature enable = false, -- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory update_cwd = false, -- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory ignore_list = {} }, -- configuration options for the system open command (`s` in the tree by default) system_open = { -- the command to run this, leaving nil should work in most cases cmd = nil, -- the command arguments as a list args = {} }, view = { -- width of the window, can be either a number (columns) or a string in `%`, for left or right side placement width = 30, -- height of the window, can be either a number (columns) or a string in `%`, for top or bottom side placement height = 30, -- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom' side = 'left', -- if true the tree will resize itself after opening a file auto_resize = false, mappings = { -- custom only false will merge the list with the default mappings -- if true, it will only use your list to set the mappings custom_only = false, -- list of mappings to set on the tree manually list = {} } } } -- }}} nvim-tree -- -- nvim-colorizer {{{ -- require 'colorizer'.setup() -- }}} nvim-colorizer -- -- gitsigns.nvim {{{ -- require('gitsigns').setup { signs = { add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, }, signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` numhl = false, -- Toggle with `:Gitsigns toggle_numhl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` keymaps = { -- Default keymap options noremap = true, ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, ['n hs'] = 'lua require"gitsigns".stage_hunk()', ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', ['n hr'] = 'lua require"gitsigns".reset_hunk()', ['v hr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', ['n hR'] = 'lua require"gitsigns".reset_buffer()', ['n hp'] = 'lua require"gitsigns".preview_hunk()', ['n hb'] = 'lua require"gitsigns".blame_line(true)', ['n hS'] = 'lua require"gitsigns".stage_buffer()', ['n hU'] = 'lua require"gitsigns".reset_buffer_index()', -- Text objects ['o ih'] = ':lua require"gitsigns.actions".select_hunk()', ['x ih'] = ':lua require"gitsigns.actions".select_hunk()' }, watch_gitdir = { interval = 1000, follow_files = true }, attach_to_untracked = true, current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame_opts = { virt_text = true, virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' delay = 1000, }, current_line_blame_formatter_opts = { relative_time = false }, sign_priority = 6, update_debounce = 100, status_formatter = nil, -- Use default max_file_length = 40000, preview_config = { -- Options passed to nvim_open_win border = 'single', style = 'minimal', relative = 'cursor', row = 0, col = 1 }, yadm = { enable = true }, } -- }}} gitsigns.nvim --