-- ┌─────────────────────────────────────┐ -- │ ▜ ▐ ▐ ▗ │ -- │▛▀▖▐ ▌ ▌▞▀▌▗▖▖▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ -- │▙▄▘▐ ▌ ▌▚▄▌▘▝ ▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ -- │▌ ▘▝▀▘▗▄▘ ▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ -- └─────────────────────────────────────┘ 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 local conditions = { spell_on = function () return vim.wo.spell end, filetype_is_tex = function() return vim.bo.filetype == "tex" end } -- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/ -- override 'encoding': don't display if encoding is utf-8. local encoding = function() local ret, _ = (vim.bo.fenc).gsub("^utf%-8$", "") return ret end -- fileformat: don't display if &ff is unix. local fileformat = function() local ret, _ = vim.bo.fileformat.gsub("^unix$", "") return ret end require'lualine'.setup { options = { icons_enabled = true, theme = "catppuccin", section_separators = { left = '', right = '' }, component_separators = { left = '', right = '' }, }, sections = { lualine_a = {{'mode', fmt = string.lower}}, lualine_b = {'branch', { 'diff', diff_color= { -- Same color values as the general color option can be used here. added = { fg = 'LightGreen' }, modified = { fg = 'LightBlue' }, -- Changes the diff's modified color removed = { fg = 'LightRed' }, -- Changes the diff's removed color you } }, { lualine_spell, cond = conditions.spell_on, }}, lualine_c = {'filename'}, lualine_x = {encoding, fileformat, 'filetype'}, lualine_y = {'progress'}, lualine_z = { 'location', { 'diagnostics', sources = {'nvim_diagnostic'}, 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 = {}, 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 g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"} g.vimtex_compiler_latexmk = { options = { "-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode' } } -- }}} vimtex -- -- 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 {{{ -- require('dashboard').setup { theme = 'hyper', config = { week_header = { enable = true, }, shortcut = { { desc = ' Update', group = '@property', action = 'PackerSync', key = 'u' }, { icon = ' ', icon_hl = '@variable', desc = 'Files', group = 'Label', action = 'Telescope find_files', key = 'f', }, }, }, } -- }}} dashboard -- -- treesitter {{{ -- require 'nvim-treesitter.configs'.setup { ensure_installed = "all", auto_install = true, highlight = { enable = true, disable = { "latex" }, 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, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), [''] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close(), }), [''] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'ultisnips' }, }, { { name = 'buffer' }, { name = 'path' }, }) }) -- }}} nvim-cmp -- -- nvim-lspconfig {{{ -- local nvim_lsp = require('lspconfig') -- Mappings. local opts = { noremap=true, silent=true } vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) local on_attach = function(client, bufnr) -- enable completion triggered by vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') -- see `:help vim.lsp.*` for documentation on any of the below functions local bufopts = { noremap=true, silent=true, buffer=bufnr } vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) vim.keymap.set('n', 'vh', vim.lsp.buf.hover, bufopts) vim.keymap.set('n', 'gh', vim.lsp.buf.implementation, bufopts) vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) vim.keymap.set('n', 'wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, bufopts) vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', 'fm', function() vim.lsp.buf.format { async = true } end, bufopts) end -- bring in cmp_nvim_lsp local capabilities = require('cmp_nvim_lsp').default_capabilities() local servers = { 'jedi_language_server', 'texlab', 'clangd' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, capabilities = capabilities } end nvim_lsp['efm'].setup { on_attach = on_attach, filetypes = { 'sh' }, capabilities = capabilities } nvim_lsp.ltex.setup { capabilities = capabilities, on_attach = function(client, bufnr) on_attach(client, bufnr) require("ltex_extra").setup { load_langs = { "en-GB" }, init_check = true, path = "/home/yigit/.local/share/nvim/ltex", log_level = "none", } end, settings = { ltex = { -- my settings here } } } -- rust-tools {{{ -- -- Configure LSP through rust-tools.nvim plugin. -- rust-tools will configure and enable certain LSP features for us. -- See https://github.com/simrat39/rust-tools.nvim#configuration local rust_opts = { tools = { runnables = { use_telescope = true, }, inlay_hints = { auto = true, show_parameter_hints = true, parameter_hints_prefix = "↸ ", other_hints_prefix = "❱ ", }, }, -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer server = { -- on_attach is a callback called when the language server attachs to the buffer on_attach = on_attach, settings = { -- to enable rust-analyzer settings visit: -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc ["rust-analyzer"] = { -- enable clippy on save checkOnSave = { command = "clippy", }, }, }, }, } require('rust-tools').setup(rust_opts) -- }}} rust-tools -- -- }}} nvim-lsp -- -- indent-blankline {{{ -- vim.opt.list = true require("indent_blankline").setup { show_current_context = true, char = "┊", buftype_exclude = {"terminal"}, filetype_exclude = {"dashboard", "help", "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")) npairs.add_rule(Rule('/*','*/',"c")) -- }}} nvim-autopairs -- -- nvim-colorizer {{{ -- require 'colorizer'.setup() -- }}} nvim-colorizer -- -- gitsigns.nvim {{{ -- require('gitsigns').setup { signs = { add = { text = '│' }, change = { text = '│' }, delete = { text = '_' }, topdelete = { text = '‾' }, changedelete = { text = '~' }, untracked = { text = '┆' }, }, 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` watch_gitdir = { 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, ignore_whitespace = false, }, current_line_blame_formatter = ', - ', sign_priority = 6, update_debounce = 100, status_formatter = nil, -- Use default max_file_length = 40000, -- Disable if file is longer than this (in lines) preview_config = { -- Options passed to nvim_open_win border = 'single', style = 'minimal', relative = 'cursor', row = 0, col = 1 }, yadm = { enable = true }, on_attach = function(bufnr) local gs = package.loaded.gitsigns local function map(mode, l, r, opts) opts = opts or {} opts.buffer = bufnr vim.keymap.set(mode, l, r, opts) end -- Navigation map('n', ']c', function() if vim.wo.diff then return ']c' end vim.schedule(function() gs.next_hunk() end) return '' end, {expr=true}) map('n', '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' end, {expr=true}) -- Actions map('n', 'hs', gs.stage_hunk) map('n', 'hr', gs.reset_hunk) map('v', 'hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) map('v', 'hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) map('n', 'hS', gs.stage_buffer) map('n', 'hu', gs.undo_stage_hunk) map('n', 'hR', gs.reset_buffer) map('n', 'hp', gs.preview_hunk) map('n', 'hb', function() gs.blame_line{full=true} end) map('n', 'tb', gs.toggle_current_line_blame) map('n', 'hd', gs.diffthis) map('n', 'hD', function() gs.diffthis('~') end) map('n', 'td', gs.toggle_deleted) -- Text object map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') end } -- }}} gitsigns.nvim -- -- Comment.nvim {{{ -- require('Comment').setup() -- }}} Comment.nvim -- -- catppuccin {{{ -- require("catppuccin").setup({ flavour = "mocha", -- latte, frappe, macchiato, mocha background = { -- :h background light = "latte", dark = "mocha", }, transparent_background = false, term_colors = false, no_italic = true, -- force no italic no_bold = false, -- force no bold integrations = { barbar = true, cmp = true, fidget = true, gitsigns = true, leap = true, nvimtree = true, telescope = true, treesitter = true, vimwiki = true, }, native_lsp = { enabled = true, underlines = { errors = { "underline" }, hints = { "underline" }, warnings = { "underline" }, information = { "underline" }, }, }, indent_blankline = { enabled = true, }, }) -- setup must be called before loading vim.cmd.colorscheme "catppuccin" -- }}} catppuccin -- -- dial.nvim {{{ -- local augend = require("dial.augend") require("dial.config").augends:register_group{ -- default augends used when no group name is specified default = { augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) augend.date.alias["%Y-%m-%d"], augend.semver.alias.semver, augend.constant.new{ elements = {"and", "or"}, word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. cyclic = true, -- "or" is incremented into "and". }, augend.constant.new{ elements = {"&&", "||"}, word = false, cyclic = true, }, }, } -- }}} dial.nvim -- -- leap.nvim {{{ -- require('leap').setup { case_insensitive = true, substitute_chars = { ['\r'] = '¬' } } -- }}} leap.nvim -- -- fidget.nvim {{{ -- require("fidget").setup{ -- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md text = { spinner = "triangle", commenced = "started", -- message shown when task starts completed = "done", -- message shown when task completes }, } -- }}} fidget.nvim -- -- nvim-tree {{{ -- require("nvim-tree").setup({ sort_by = "case_sensitive", diagnostics = { enable = false, icons = { hint = "❔", info = "❕", warning = "❗", error = "❌", } }, view = { adaptive_size = true, }, renderer = { group_empty = true, }, filters = { dotfiles = true, }, }) -- }}} nvim-tree -- -- barbar.nvim {{{ -- vim.g.barbar_auto_setup = false -- disable auto-setup require'barbar'.setup { animation = false, auto_hide = true, tabpages = true, closable = true, clickable = false, icons = { diagnostics = { -- `vim.diagnostic.severity` [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'}, [vim.diagnostic.severity.WARN] = {enabled = false}, [vim.diagnostic.severity.INFO] = {enabled = false}, [vim.diagnostic.severity.HINT] = {enabled = true}, }, filetype = { custom_colors = false, enabled = true, }, separator = { left = '▎', right = ''}, modified = { button = '•'}, pinned = { button = '車', filename = true, separator = { right = ''}}, }, insert_at_end = false, insert_at_start = false, maximum_padding = 1, minimum_padding = 1, maximum_length = 30, semantic_letters = true, letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM', no_name_title = nil, } local nvim_tree_events = require('nvim-tree.events') local bufferline_api = require('bufferline.api') local function get_tree_size() return require'nvim-tree.view'.View.width end nvim_tree_events.subscribe('TreeOpen', function() bufferline_api.set_offset(get_tree_size()) end) nvim_tree_events.subscribe('Resize', function() bufferline_api.set_offset(get_tree_size()) end) nvim_tree_events.subscribe('TreeClose', function() bufferline_api.set_offset(0) end) -- }}} barbar.nvim --