diff options
Diffstat (limited to '.config/nvim/lua/plugin_settings.lua')
| -rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 722 |
1 files changed, 0 insertions, 722 deletions
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua deleted file mode 100644 index 351592d..0000000 --- a/.config/nvim/lua/plugin_settings.lua +++ /dev/null | |||
| @@ -1,722 +0,0 @@ | |||
| 1 | -- ┌─────────────────────────────────────┐ | ||
| 2 | -- │ ▜ ▐ ▐ ▗ │ | ||
| 3 | -- │▛▀▖▐ ▌ ▌▞▀▌▗▖▖▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ | ||
| 4 | -- │▙▄▘▐ ▌ ▌▚▄▌▘▝ ▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ | ||
| 5 | -- │▌ ▘▝▀▘▗▄▘ ▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ | ||
| 6 | -- └─────────────────────────────────────┘ | ||
| 7 | |||
| 8 | local g = vim.g -- global for let options | ||
| 9 | local opt = vim.opt -- convenient :set | ||
| 10 | local cmd = vim.cmd -- vim commands | ||
| 11 | |||
| 12 | -- vimwiki {{{ -- | ||
| 13 | g.vimwiki_list = { | ||
| 14 | { | ||
| 15 | path = '/home/yigit/nextcloud/personal_wiki/text', | ||
| 16 | path_html = '/home/yigit/nextcloud/personal_wiki/html', | ||
| 17 | auto_generate_tags = 1, | ||
| 18 | automatic_nested_syntaxes = 1, | ||
| 19 | template_path = '/home/yigit/nextcloud/personal_wiki/templates', | ||
| 20 | template_default = 'default_template', | ||
| 21 | template_ext = '.html', | ||
| 22 | auto_export = 1, | ||
| 23 | auto_tags = 1 | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | g.vimwiki_global_ext = 0 | ||
| 28 | g.vimwiki_hl_headers = 1 | ||
| 29 | -- }}} vimwiki -- | ||
| 30 | |||
| 31 | -- lualine {{{ -- | ||
| 32 | |||
| 33 | local function lualine_spell() | ||
| 34 | if vim.wo.spell then | ||
| 35 | return "spell" | ||
| 36 | else | ||
| 37 | return | ||
| 38 | end | ||
| 39 | end | ||
| 40 | |||
| 41 | local conditions = { | ||
| 42 | spell_on = function () | ||
| 43 | return vim.wo.spell | ||
| 44 | end, | ||
| 45 | filetype_is_tex = function() | ||
| 46 | return vim.bo.filetype == "tex" | ||
| 47 | end | ||
| 48 | } | ||
| 49 | |||
| 50 | -- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/ | ||
| 51 | -- override 'encoding': don't display if encoding is utf-8. | ||
| 52 | local encoding = function() | ||
| 53 | local ret, _ = (vim.bo.fenc).gsub("^utf%-8$", "") | ||
| 54 | return ret | ||
| 55 | end | ||
| 56 | |||
| 57 | -- fileformat: don't display if &ff is unix. | ||
| 58 | local fileformat = function() | ||
| 59 | local ret, _ = vim.bo.fileformat.gsub("^unix$", "") | ||
| 60 | return ret | ||
| 61 | end | ||
| 62 | |||
| 63 | require'lualine'.setup { | ||
| 64 | options = { | ||
| 65 | icons_enabled = true, | ||
| 66 | theme = "catppuccin", | ||
| 67 | section_separators = { left = '', right = '' }, | ||
| 68 | component_separators = { left = '', right = '' }, | ||
| 69 | }, | ||
| 70 | sections = { | ||
| 71 | lualine_a = {{'mode', fmt = string.lower}}, | ||
| 72 | lualine_b = {'branch', | ||
| 73 | { | ||
| 74 | 'diff', | ||
| 75 | diff_color= { | ||
| 76 | -- Same color values as the general color option can be used here. | ||
| 77 | added = { fg = 'LightGreen' }, | ||
| 78 | modified = { fg = 'LightBlue' }, -- Changes the diff's modified color | ||
| 79 | removed = { fg = 'LightRed' }, -- Changes the diff's removed color you | ||
| 80 | } | ||
| 81 | }, | ||
| 82 | { | ||
| 83 | lualine_spell, | ||
| 84 | cond = conditions.spell_on, | ||
| 85 | }}, | ||
| 86 | lualine_c = {'filename'}, | ||
| 87 | lualine_x = {encoding, fileformat, 'filetype'}, | ||
| 88 | lualine_y = {'progress'}, | ||
| 89 | lualine_z = { | ||
| 90 | 'location', { | ||
| 91 | 'diagnostics', | ||
| 92 | sources = {'nvim_diagnostic'}, | ||
| 93 | sections = {'error', 'warn', 'info', 'hint'}, | ||
| 94 | symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} | ||
| 95 | } | ||
| 96 | } | ||
| 97 | }, | ||
| 98 | inactive_sections = { | ||
| 99 | lualine_a = {}, | ||
| 100 | lualine_b = {}, | ||
| 101 | lualine_c = {'filename'}, | ||
| 102 | lualine_x = {}, | ||
| 103 | lualine_y = {}, | ||
| 104 | lualine_z = {} | ||
| 105 | }, | ||
| 106 | tabline = {}, | ||
| 107 | extensions = {} | ||
| 108 | } | ||
| 109 | |||
| 110 | -- }}} lualine -- | ||
| 111 | |||
| 112 | -- cutlass suite {{{ -- | ||
| 113 | |||
| 114 | -- cutlass/yoink/subverse suite | ||
| 115 | g.yoinkIncludeDeleteOperations = 1 | ||
| 116 | |||
| 117 | -- fix the Target STRING not available | ||
| 118 | g.clipboard = { | ||
| 119 | name = 'xsel_override', | ||
| 120 | copy = { | ||
| 121 | ['+'] = 'xsel --input --clipboard', | ||
| 122 | ['*'] = 'xsel --input --primary', | ||
| 123 | }, | ||
| 124 | paste = { | ||
| 125 | ['+'] = 'xsel --output --clipboard', | ||
| 126 | ['*'] = 'xsel --output --primary', | ||
| 127 | }, | ||
| 128 | cache_enabled = 1, | ||
| 129 | } | ||
| 130 | |||
| 131 | -- }}} cutlass suite -- | ||
| 132 | |||
| 133 | -- UltiSnips {{{ -- | ||
| 134 | g.UltiSnipsEditSplit = "vertical" | ||
| 135 | -- ctrl + l expands the snippet, c + j/k navigates placeholders | ||
| 136 | g.UltiSnipsExpandTrigger = "<tab>" | ||
| 137 | g.UltiSnipsEnableSnipMate = "1" | ||
| 138 | g.UltiSnipsSnippetDirectories = {"my_snippets", "UltiSnips"} | ||
| 139 | -- }}} UltiSnips -- | ||
| 140 | |||
| 141 | -- vimtex {{{ -- | ||
| 142 | g.vimtex_view_method = 'zathura' | ||
| 143 | g.vimtex_quickfix_mode = 0 | ||
| 144 | g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"} | ||
| 145 | |||
| 146 | g.vimtex_compiler_latexmk = { | ||
| 147 | options = { | ||
| 148 | "-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode' | ||
| 149 | } | ||
| 150 | } | ||
| 151 | |||
| 152 | -- }}} vimtex -- | ||
| 153 | |||
| 154 | -- devicons {{{ -- | ||
| 155 | require'nvim-web-devicons'.setup { | ||
| 156 | override = { | ||
| 157 | wiki = { | ||
| 158 | icon = "", | ||
| 159 | color = "#D7827E", | ||
| 160 | name = "vimwiki" | ||
| 161 | }, | ||
| 162 | rem = { | ||
| 163 | icon = "", | ||
| 164 | color = "#B4637A", | ||
| 165 | name = "remind" | ||
| 166 | }, | ||
| 167 | mail = { | ||
| 168 | icon = "", | ||
| 169 | color = "#907AA9", | ||
| 170 | name = "mail" | ||
| 171 | }, | ||
| 172 | }; | ||
| 173 | |||
| 174 | default = true | ||
| 175 | } | ||
| 176 | -- }}} devicons -- | ||
| 177 | |||
| 178 | -- vim-slime {{{ -- | ||
| 179 | g.slime_target = "tmux" | ||
| 180 | g.slime_paste_file = "$HOME/.slime_paste" | ||
| 181 | g.slime_default_config = {socket_name = vim.call("get", vim.call("split", vim.env.TMUX, ','), "0"), target_pane = "{last}"} | ||
| 182 | -- }}} vim-slime -- | ||
| 183 | |||
| 184 | -- gutentags {{{ -- | ||
| 185 | g.gutentags_enabled = 1 | ||
| 186 | g.gutentags_add_default_project_roots = 0 | ||
| 187 | g.gutentags_project_root = {'Makefile', '.git'} | ||
| 188 | g.gutentags_exclude_filetypes = {'gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git'} | ||
| 189 | g.gutentags_generate_on_new = 1 | ||
| 190 | g.gutentags_generate_on_missing = 1 | ||
| 191 | g.gutentags_generate_on_write = 1 | ||
| 192 | g.gutentags_generate_on_empty_buffer = 0 | ||
| 193 | g.gutentags_ctags_exclude = { | ||
| 194 | '*.git', '*.svn', '*.hg', | ||
| 195 | 'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components', | ||
| 196 | '*-lock.json', '*.lock', | ||
| 197 | '*.min.*', | ||
| 198 | '*.bak', | ||
| 199 | '*.zip', | ||
| 200 | '*.pyc', | ||
| 201 | '*.class', | ||
| 202 | '*.sln', | ||
| 203 | '*.csproj', '*.csproj.user', | ||
| 204 | '*.tmp', | ||
| 205 | '*.cache', | ||
| 206 | '*.vscode', | ||
| 207 | '*.pdb', | ||
| 208 | '*.exe', '*.dll', '*.bin', | ||
| 209 | '*.mp3', '*.ogg', '*.flac', | ||
| 210 | '*.swp', '*.swo', | ||
| 211 | '.DS_Store', '*.plist', | ||
| 212 | '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg', | ||
| 213 | '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2', | ||
| 214 | '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls', | ||
| 215 | } | ||
| 216 | -- }}} gutentags -- | ||
| 217 | |||
| 218 | -- telescope {{{ -- | ||
| 219 | require('telescope').setup { | ||
| 220 | extensions = { | ||
| 221 | fzf = { | ||
| 222 | fuzzy = true, -- false will only do exact matching | ||
| 223 | override_generic_sorter = true, -- override the generic sorter | ||
| 224 | override_file_sorter = true, -- override the file sorter | ||
| 225 | case_mode = "smart_case", -- or "ignore_case" or "respect_case" | ||
| 226 | -- the default case_mode is "smart_case" | ||
| 227 | } | ||
| 228 | } | ||
| 229 | } | ||
| 230 | |||
| 231 | require('telescope').load_extension('fzf') | ||
| 232 | -- }}} telescope -- | ||
| 233 | |||
| 234 | -- dashboard {{{ -- | ||
| 235 | |||
| 236 | require('dashboard').setup { | ||
| 237 | theme = 'hyper', | ||
| 238 | config = { | ||
| 239 | week_header = { | ||
| 240 | enable = true, | ||
| 241 | }, | ||
| 242 | shortcut = { | ||
| 243 | { desc = ' Update', group = '@property', action = 'PackerSync', key = 'u' }, | ||
| 244 | { | ||
| 245 | icon = ' ', | ||
| 246 | icon_hl = '@variable', | ||
| 247 | desc = 'Files', | ||
| 248 | group = 'Label', | ||
| 249 | action = 'Telescope find_files', | ||
| 250 | key = 'f', | ||
| 251 | }, | ||
| 252 | }, | ||
| 253 | }, | ||
| 254 | } | ||
| 255 | |||
| 256 | -- }}} dashboard -- | ||
| 257 | |||
| 258 | -- treesitter {{{ -- | ||
| 259 | |||
| 260 | require 'nvim-treesitter.configs'.setup { | ||
| 261 | ensure_installed = "all", | ||
| 262 | auto_install = true, | ||
| 263 | highlight = { | ||
| 264 | enable = true, | ||
| 265 | disable = { "latex" }, | ||
| 266 | additional_vim_regex_highlighting = false, | ||
| 267 | }, | ||
| 268 | incremental_selection = { | ||
| 269 | enable = true, | ||
| 270 | keymaps = { | ||
| 271 | init_selection = "gnn", | ||
| 272 | node_incremental = "grn", | ||
| 273 | scope_incremental = "grc", | ||
| 274 | node_decremental = "grm", | ||
| 275 | }, | ||
| 276 | }, | ||
| 277 | indent = { | ||
| 278 | enable = true | ||
| 279 | } | ||
| 280 | } | ||
| 281 | -- }}} treesitter -- | ||
| 282 | |||
| 283 | -- nvim-cmp {{{ -- | ||
| 284 | local cmp = require'cmp' | ||
| 285 | |||
| 286 | cmp.setup({ | ||
| 287 | snippet = { | ||
| 288 | expand = function(args) | ||
| 289 | vim.fn["UltiSnips#Anon"](args.body) | ||
| 290 | end, | ||
| 291 | }, | ||
| 292 | window = { | ||
| 293 | completion = cmp.config.window.bordered(), | ||
| 294 | documentation = cmp.config.window.bordered(), | ||
| 295 | }, | ||
| 296 | mapping = cmp.mapping.preset.insert({ | ||
| 297 | ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), | ||
| 298 | ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), | ||
| 299 | ['<C-c>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), | ||
| 300 | ['<C-e>'] = cmp.mapping({ | ||
| 301 | i = cmp.mapping.abort(), | ||
| 302 | c = cmp.mapping.close(), | ||
| 303 | }), | ||
| 304 | ['<C-l>'] = cmp.mapping.confirm({ select = true }), | ||
| 305 | }), | ||
| 306 | sources = cmp.config.sources({ | ||
| 307 | { name = 'nvim_lsp' }, | ||
| 308 | { name = 'ultisnips' }, | ||
| 309 | }, { | ||
| 310 | { name = 'buffer' }, | ||
| 311 | { name = 'path' }, | ||
| 312 | }) | ||
| 313 | }) | ||
| 314 | |||
| 315 | -- }}} nvim-cmp -- | ||
| 316 | |||
| 317 | -- nvim-lspconfig {{{ -- | ||
| 318 | local nvim_lsp = require('lspconfig') | ||
| 319 | |||
| 320 | -- Mappings. | ||
| 321 | local opts = { noremap=true, silent=true } | ||
| 322 | vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts) | ||
| 323 | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) | ||
| 324 | vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) | ||
| 325 | vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts) | ||
| 326 | |||
| 327 | local on_attach = function(client, bufnr) | ||
| 328 | -- enable completion triggered by <c-x><c-o> | ||
| 329 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') | ||
| 330 | |||
| 331 | -- see `:help vim.lsp.*` for documentation on any of the below functions | ||
| 332 | local bufopts = { noremap=true, silent=true, buffer=bufnr } | ||
| 333 | vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) | ||
| 334 | vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) | ||
| 335 | vim.keymap.set('n', 'vh', vim.lsp.buf.hover, bufopts) | ||
| 336 | vim.keymap.set('n', 'gh', vim.lsp.buf.implementation, bufopts) | ||
| 337 | vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) | ||
| 338 | vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) | ||
| 339 | vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) | ||
| 340 | vim.keymap.set('n', '<leader>wl', function() | ||
| 341 | print(vim.inspect(vim.lsp.buf.list_workspace_folders())) | ||
| 342 | end, bufopts) | ||
| 343 | vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) | ||
| 344 | vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts) | ||
| 345 | vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) | ||
| 346 | vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) | ||
| 347 | vim.keymap.set('n', '<leader>fm', function() vim.lsp.buf.format { async = true } end, bufopts) | ||
| 348 | end | ||
| 349 | |||
| 350 | -- bring in cmp_nvim_lsp | ||
| 351 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | ||
| 352 | |||
| 353 | local servers = { 'jedi_language_server', 'texlab', 'clangd', 'denols' } | ||
| 354 | for _, lsp in ipairs(servers) do | ||
| 355 | nvim_lsp[lsp].setup { | ||
| 356 | on_attach = on_attach, | ||
| 357 | capabilities = capabilities | ||
| 358 | } | ||
| 359 | end | ||
| 360 | |||
| 361 | nvim_lsp['efm'].setup { | ||
| 362 | on_attach = on_attach, | ||
| 363 | filetypes = { 'sh' }, | ||
| 364 | capabilities = capabilities | ||
| 365 | } | ||
| 366 | |||
| 367 | nvim_lsp.ltex.setup { | ||
| 368 | capabilities = capabilities, | ||
| 369 | on_attach = function(client, bufnr) | ||
| 370 | on_attach(client, bufnr) | ||
| 371 | require("ltex_extra").setup { | ||
| 372 | load_langs = { "en-GB" }, | ||
| 373 | init_check = true, | ||
| 374 | path = "/home/yigit/.local/share/nvim/ltex", | ||
| 375 | log_level = "none", | ||
| 376 | } | ||
| 377 | end, | ||
| 378 | settings = { | ||
| 379 | ltex = { | ||
| 380 | -- my settings here | ||
| 381 | } | ||
| 382 | } | ||
| 383 | } | ||
| 384 | |||
| 385 | -- rust-tools {{{ -- | ||
| 386 | |||
| 387 | -- Configure LSP through rust-tools.nvim plugin. | ||
| 388 | -- rust-tools will configure and enable certain LSP features for us. | ||
| 389 | -- See https://github.com/simrat39/rust-tools.nvim#configuration | ||
| 390 | local rust_opts = { | ||
| 391 | tools = { | ||
| 392 | runnables = { | ||
| 393 | use_telescope = true, | ||
| 394 | }, | ||
| 395 | inlay_hints = { | ||
| 396 | auto = true, | ||
| 397 | show_parameter_hints = true, | ||
| 398 | parameter_hints_prefix = "↸ ", | ||
| 399 | other_hints_prefix = "❱ ", | ||
| 400 | }, | ||
| 401 | }, | ||
| 402 | |||
| 403 | -- all the opts to send to nvim-lspconfig | ||
| 404 | -- these override the defaults set by rust-tools.nvim | ||
| 405 | -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer | ||
| 406 | server = { | ||
| 407 | -- on_attach is a callback called when the language server attachs to the buffer | ||
| 408 | on_attach = on_attach, | ||
| 409 | settings = { | ||
| 410 | -- to enable rust-analyzer settings visit: | ||
| 411 | -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc | ||
| 412 | ["rust-analyzer"] = { | ||
| 413 | -- enable clippy on save | ||
| 414 | checkOnSave = { | ||
| 415 | command = "clippy", | ||
| 416 | }, | ||
| 417 | }, | ||
| 418 | }, | ||
| 419 | }, | ||
| 420 | } | ||
| 421 | |||
| 422 | require('rust-tools').setup(rust_opts) | ||
| 423 | |||
| 424 | -- }}} rust-tools -- | ||
| 425 | |||
| 426 | -- }}} nvim-lsp -- | ||
| 427 | |||
| 428 | -- indent-blankline {{{ -- | ||
| 429 | vim.opt.list = true | ||
| 430 | |||
| 431 | require("indent_blankline").setup { | ||
| 432 | show_current_context = true, | ||
| 433 | char = "┊", | ||
| 434 | buftype_exclude = {"terminal"}, | ||
| 435 | filetype_exclude = {"dashboard", "help", "man"} | ||
| 436 | } | ||
| 437 | -- }}} indent-blankline -- | ||
| 438 | |||
| 439 | -- nvim-autopairs {{{ -- | ||
| 440 | |||
| 441 | require('nvim-autopairs').setup({ | ||
| 442 | disable_filetype = { "TelescopePrompt" }, | ||
| 443 | }) | ||
| 444 | |||
| 445 | local cmp_autopairs = require('nvim-autopairs.completion.cmp') | ||
| 446 | local cmp = require('cmp') | ||
| 447 | cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done()) | ||
| 448 | |||
| 449 | local Rule = require('nvim-autopairs.rule') | ||
| 450 | local npairs = require('nvim-autopairs') | ||
| 451 | |||
| 452 | npairs.add_rule(Rule('%"','%"',"remind")) | ||
| 453 | npairs.add_rule(Rule('/*','*/',"c")) | ||
| 454 | |||
| 455 | -- }}} nvim-autopairs -- | ||
| 456 | |||
| 457 | -- nvim-colorizer {{{ -- | ||
| 458 | require 'colorizer'.setup() | ||
| 459 | -- }}} nvim-colorizer -- | ||
| 460 | |||
| 461 | -- gitsigns.nvim {{{ -- | ||
| 462 | |||
| 463 | require('gitsigns').setup { | ||
| 464 | signs = { | ||
| 465 | add = { text = '│' }, | ||
| 466 | change = { text = '│' }, | ||
| 467 | delete = { text = '_' }, | ||
| 468 | topdelete = { text = '‾' }, | ||
| 469 | changedelete = { text = '~' }, | ||
| 470 | untracked = { text = '┆' }, | ||
| 471 | }, | ||
| 472 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` | ||
| 473 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` | ||
| 474 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` | ||
| 475 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` | ||
| 476 | watch_gitdir = { | ||
| 477 | follow_files = true | ||
| 478 | }, | ||
| 479 | attach_to_untracked = true, | ||
| 480 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` | ||
| 481 | current_line_blame_opts = { | ||
| 482 | virt_text = true, | ||
| 483 | virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' | ||
| 484 | delay = 1000, | ||
| 485 | ignore_whitespace = false, | ||
| 486 | }, | ||
| 487 | current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>', | ||
| 488 | sign_priority = 6, | ||
| 489 | update_debounce = 100, | ||
| 490 | status_formatter = nil, -- Use default | ||
| 491 | max_file_length = 40000, -- Disable if file is longer than this (in lines) | ||
| 492 | preview_config = { | ||
| 493 | -- Options passed to nvim_open_win | ||
| 494 | border = 'single', | ||
| 495 | style = 'minimal', | ||
| 496 | relative = 'cursor', | ||
| 497 | row = 0, | ||
| 498 | col = 1 | ||
| 499 | }, | ||
| 500 | yadm = { | ||
| 501 | enable = true | ||
| 502 | }, | ||
| 503 | |||
| 504 | on_attach = function(bufnr) | ||
| 505 | local gs = package.loaded.gitsigns | ||
| 506 | |||
| 507 | local function map(mode, l, r, opts) | ||
| 508 | opts = opts or {} | ||
| 509 | opts.buffer = bufnr | ||
| 510 | vim.keymap.set(mode, l, r, opts) | ||
| 511 | end | ||
| 512 | |||
| 513 | -- Navigation | ||
| 514 | map('n', ']c', function() | ||
| 515 | if vim.wo.diff then return ']c' end | ||
| 516 | vim.schedule(function() gs.next_hunk() end) | ||
| 517 | return '<Ignore>' | ||
| 518 | end, {expr=true}) | ||
| 519 | |||
| 520 | map('n', '[c', function() | ||
| 521 | if vim.wo.diff then return '[c' end | ||
| 522 | vim.schedule(function() gs.prev_hunk() end) | ||
| 523 | return '<Ignore>' | ||
| 524 | end, {expr=true}) | ||
| 525 | |||
| 526 | -- Actions | ||
| 527 | map('n', '<leader>hs', gs.stage_hunk) | ||
| 528 | map('n', '<leader>hr', gs.reset_hunk) | ||
| 529 | map('v', '<leader>hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) | ||
| 530 | map('v', '<leader>hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) | ||
| 531 | map('n', '<leader>hS', gs.stage_buffer) | ||
| 532 | map('n', '<leader>hu', gs.undo_stage_hunk) | ||
| 533 | map('n', '<leader>hR', gs.reset_buffer) | ||
| 534 | map('n', '<leader>hp', gs.preview_hunk) | ||
| 535 | map('n', '<leader>hb', function() gs.blame_line{full=true} end) | ||
| 536 | map('n', '<leader>tb', gs.toggle_current_line_blame) | ||
| 537 | map('n', '<leader>hd', gs.diffthis) | ||
| 538 | map('n', '<leader>hD', function() gs.diffthis('~') end) | ||
| 539 | map('n', '<leader>td', gs.toggle_deleted) | ||
| 540 | |||
| 541 | -- Text object | ||
| 542 | map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>') | ||
| 543 | end | ||
| 544 | } | ||
| 545 | |||
| 546 | -- }}} gitsigns.nvim -- | ||
| 547 | |||
| 548 | -- Comment.nvim {{{ -- | ||
| 549 | require('Comment').setup() | ||
| 550 | -- }}} Comment.nvim -- | ||
| 551 | |||
| 552 | -- catppuccin {{{ -- | ||
| 553 | require("catppuccin").setup({ | ||
| 554 | flavour = "mocha", -- latte, frappe, macchiato, mocha | ||
| 555 | background = { -- :h background | ||
| 556 | light = "latte", | ||
| 557 | dark = "mocha", | ||
| 558 | }, | ||
| 559 | transparent_background = false, | ||
| 560 | term_colors = false, | ||
| 561 | no_italic = true, -- force no italic | ||
| 562 | no_bold = false, -- force no bold | ||
| 563 | integrations = { | ||
| 564 | barbar = true, | ||
| 565 | cmp = true, | ||
| 566 | fidget = true, | ||
| 567 | gitsigns = true, | ||
| 568 | leap = true, | ||
| 569 | nvimtree = true, | ||
| 570 | telescope = true, | ||
| 571 | treesitter = true, | ||
| 572 | vimwiki = true, | ||
| 573 | }, | ||
| 574 | native_lsp = { | ||
| 575 | enabled = true, | ||
| 576 | underlines = { | ||
| 577 | errors = { "underline" }, | ||
| 578 | hints = { "underline" }, | ||
| 579 | warnings = { "underline" }, | ||
| 580 | information = { "underline" }, | ||
| 581 | }, | ||
| 582 | |||
| 583 | }, | ||
| 584 | indent_blankline = { | ||
| 585 | enabled = true, | ||
| 586 | }, | ||
| 587 | }) | ||
| 588 | |||
| 589 | -- setup must be called before loading | ||
| 590 | vim.cmd.colorscheme "catppuccin" | ||
| 591 | |||
| 592 | -- }}} catppuccin -- | ||
| 593 | |||
| 594 | -- dial.nvim {{{ -- | ||
| 595 | |||
| 596 | local augend = require("dial.augend") | ||
| 597 | require("dial.config").augends:register_group{ | ||
| 598 | -- default augends used when no group name is specified | ||
| 599 | default = { | ||
| 600 | augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) | ||
| 601 | augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) | ||
| 602 | augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) | ||
| 603 | augend.date.alias["%Y-%m-%d"], | ||
| 604 | augend.semver.alias.semver, | ||
| 605 | augend.constant.new{ | ||
| 606 | elements = {"and", "or"}, | ||
| 607 | word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. | ||
| 608 | cyclic = true, -- "or" is incremented into "and". | ||
| 609 | }, | ||
| 610 | augend.constant.new{ | ||
| 611 | elements = {"&&", "||"}, | ||
| 612 | word = false, | ||
| 613 | cyclic = true, | ||
| 614 | }, | ||
| 615 | }, | ||
| 616 | } | ||
| 617 | |||
| 618 | -- }}} dial.nvim -- | ||
| 619 | |||
| 620 | -- leap.nvim {{{ -- | ||
| 621 | require('leap').setup { | ||
| 622 | case_insensitive = true, | ||
| 623 | substitute_chars = { ['\r'] = '¬' } | ||
| 624 | } | ||
| 625 | |||
| 626 | -- }}} leap.nvim -- | ||
| 627 | |||
| 628 | -- fidget.nvim {{{ -- | ||
| 629 | require("fidget").setup{ | ||
| 630 | -- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md | ||
| 631 | text = { | ||
| 632 | spinner = "triangle", | ||
| 633 | commenced = "started", -- message shown when task starts | ||
| 634 | completed = "done", -- message shown when task completes | ||
| 635 | }, | ||
| 636 | } | ||
| 637 | -- }}} fidget.nvim -- | ||
| 638 | |||
| 639 | -- nvim-tree {{{ -- | ||
| 640 | |||
| 641 | require("nvim-tree").setup({ | ||
| 642 | sort_by = "case_sensitive", | ||
| 643 | diagnostics = { | ||
| 644 | enable = false, | ||
| 645 | icons = { | ||
| 646 | hint = "❔", | ||
| 647 | info = "❕", | ||
| 648 | warning = "❗", | ||
| 649 | error = "❌", | ||
| 650 | } | ||
| 651 | }, | ||
| 652 | view = { | ||
| 653 | adaptive_size = true, | ||
| 654 | }, | ||
| 655 | renderer = { | ||
| 656 | group_empty = true, | ||
| 657 | }, | ||
| 658 | filters = { | ||
| 659 | dotfiles = true, | ||
| 660 | }, | ||
| 661 | }) | ||
| 662 | |||
| 663 | -- }}} nvim-tree -- | ||
| 664 | |||
| 665 | -- barbar.nvim {{{ -- | ||
| 666 | |||
| 667 | vim.g.barbar_auto_setup = false -- disable auto-setup | ||
| 668 | |||
| 669 | require'barbar'.setup { | ||
| 670 | animation = false, | ||
| 671 | auto_hide = true, | ||
| 672 | tabpages = true, | ||
| 673 | closable = true, | ||
| 674 | clickable = false, | ||
| 675 | icons = { | ||
| 676 | diagnostics = { | ||
| 677 | -- `vim.diagnostic.severity` | ||
| 678 | [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'}, | ||
| 679 | [vim.diagnostic.severity.WARN] = {enabled = false}, | ||
| 680 | [vim.diagnostic.severity.INFO] = {enabled = false}, | ||
| 681 | [vim.diagnostic.severity.HINT] = {enabled = true}, | ||
| 682 | }, | ||
| 683 | filetype = { | ||
| 684 | custom_colors = false, | ||
| 685 | enabled = true, | ||
| 686 | }, | ||
| 687 | separator = { left = '▎', right = ''}, | ||
| 688 | modified = { button = '•'}, | ||
| 689 | pinned = { button = '車', filename = true, separator = { right = ''}}, | ||
| 690 | }, | ||
| 691 | |||
| 692 | insert_at_end = false, | ||
| 693 | insert_at_start = false, | ||
| 694 | |||
| 695 | maximum_padding = 1, | ||
| 696 | minimum_padding = 1, | ||
| 697 | maximum_length = 30, | ||
| 698 | semantic_letters = true, | ||
| 699 | letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM', | ||
| 700 | no_name_title = nil, | ||
| 701 | } | ||
| 702 | |||
| 703 | local nvim_tree_events = require('nvim-tree.events') | ||
| 704 | local bufferline_api = require('bufferline.api') | ||
| 705 | |||
| 706 | local function get_tree_size() | ||
| 707 | return require'nvim-tree.view'.View.width | ||
| 708 | end | ||
| 709 | |||
| 710 | nvim_tree_events.subscribe('TreeOpen', function() | ||
| 711 | bufferline_api.set_offset(get_tree_size()) | ||
| 712 | end) | ||
| 713 | |||
| 714 | nvim_tree_events.subscribe('Resize', function() | ||
| 715 | bufferline_api.set_offset(get_tree_size()) | ||
| 716 | end) | ||
| 717 | |||
| 718 | nvim_tree_events.subscribe('TreeClose', function() | ||
| 719 | bufferline_api.set_offset(0) | ||
| 720 | end) | ||
| 721 | |||
| 722 | -- }}} barbar.nvim -- | ||
