diff options
Diffstat (limited to 'vim')
| -rw-r--r-- | vim/init.vim | 2 | ||||
| -rw-r--r-- | vim/init/config.vim | 4 | ||||
| -rw-r--r-- | vim/init/keymaps.vim | 8 | ||||
| -rw-r--r-- | vim/mini.lua | 70 |
4 files changed, 49 insertions, 35 deletions
diff --git a/vim/init.vim b/vim/init.vim index c1dee81..59be77e 100644 --- a/vim/init.vim +++ b/vim/init.vim | |||
| @@ -30,3 +30,5 @@ else | |||
| 30 | endif | 30 | endif |
| 31 | 31 | ||
| 32 | LoadScript init/highlight.vim | 32 | LoadScript init/highlight.vim |
| 33 | |||
| 34 | source ~/.projects.vim | ||
diff --git a/vim/init/config.vim b/vim/init/config.vim index 74cbd39..4676942 100644 --- a/vim/init/config.vim +++ b/vim/init/config.vim | |||
| @@ -188,11 +188,13 @@ augroup InitFileTypes | |||
| 188 | endif | 188 | endif |
| 189 | 189 | ||
| 190 | " Fold for heading and the following contents | 190 | " Fold for heading and the following contents |
| 191 | let hash_num = matchstr(getline(v:lnum), '^#\+') | 191 | let hash_num = matchstr(getline(v:lnum), '^\zs#\+\ze\s') |
| 192 | if !empty(hash_num) | 192 | if !empty(hash_num) |
| 193 | let foldlevel = g:markdown_apply_heading_level ? len(hash_num) - 1 : 1 | 193 | let foldlevel = g:markdown_apply_heading_level ? len(hash_num) - 1 : 1 |
| 194 | " HEADING | 194 | " HEADING |
| 195 | return len(hash_num) == 1 ? 0 : '>'.foldlevel | 195 | return len(hash_num) == 1 ? 0 : '>'.foldlevel |
| 196 | elseif match(getline(v:lnum), '^----') != -1 | ||
| 197 | return "<" | ||
| 196 | else | 198 | else |
| 197 | " Contents | 199 | " Contents |
| 198 | return "=" | 200 | return "=" |
diff --git a/vim/init/keymaps.vim b/vim/init/keymaps.vim index c0af8c8..bf3d7ab 100644 --- a/vim/init/keymaps.vim +++ b/vim/init/keymaps.vim | |||
| @@ -92,6 +92,11 @@ nnoremap gF :e <cfile><CR> | |||
| 92 | xnoremap iq i" | 92 | xnoremap iq i" |
| 93 | xnoremap aq a" | 93 | xnoremap aq a" |
| 94 | 94 | ||
| 95 | nnoremap ze zszH | ||
| 96 | |||
| 97 | nnoremap 0 ^ | ||
| 98 | nnoremap ^ 0 | ||
| 99 | |||
| 95 | 100 | ||
| 96 | " READLINE {{{ | 101 | " READLINE {{{ |
| 97 | 102 | ||
| @@ -495,8 +500,9 @@ function! CloseBufferSafely() | |||
| 495 | tabclose | 500 | tabclose |
| 496 | else | 501 | else |
| 497 | " Switch to proper buffer | 502 | " Switch to proper buffer |
| 498 | let next_buf = get(t:bufs, bufnr('#')) ? bufnr('#') : filter(t:bufs, 'v:val != '..bufnr)[0] | 503 | let next_buf = get(t:bufs, bufnr('#')) ? bufnr('#') : filter(t:bufs, 'v:val != '..bufnr)[-1] |
| 499 | exe "b "..next_buf | 504 | exe "b "..next_buf |
| 505 | " exe "buffer ".g:lastbuffer | ||
| 500 | call filter(t:bufs, 'v:val != '..bufnr) | 506 | call filter(t:bufs, 'v:val != '..bufnr) |
| 501 | endif | 507 | endif |
| 502 | 508 | ||
diff --git a/vim/mini.lua b/vim/mini.lua index 92f9efe..0658d4d 100644 --- a/vim/mini.lua +++ b/vim/mini.lua | |||
| @@ -1412,39 +1412,43 @@ require("lazy").setup({ | |||
| 1412 | }, | 1412 | }, |
| 1413 | 1413 | ||
| 1414 | -- }}} | 1414 | -- }}} |
| 1415 | -- -- lspsaga {{{ | 1415 | -- lspsaga {{{ |
| 1416 | -- { | 1416 | { |
| 1417 | -- 'nvimdev/lspsaga.nvim', | 1417 | 'nvimdev/lspsaga.nvim', |
| 1418 | -- dependencies = { | 1418 | dependencies = { |
| 1419 | -- 'nvim-treesitter/nvim-treesitter', -- optional | 1419 | 'nvim-treesitter/nvim-treesitter', -- optional |
| 1420 | -- 'nvim-tree/nvim-web-devicons', -- optional | 1420 | 'nvim-tree/nvim-web-devicons', -- optional |
| 1421 | -- }, | 1421 | }, |
| 1422 | -- config = function() | 1422 | config = function() |
| 1423 | -- require('lspsaga').setup({ | 1423 | require('lspsaga').setup({ |
| 1424 | -- autochdir = true, | 1424 | autochdir = true, |
| 1425 | -- }) | 1425 | lightbulb = { |
| 1426 | -- vim.api.nvim_create_autocmd("LspAttach", { | 1426 | sign = false, |
| 1427 | -- group = custom_autocommands, | 1427 | virtual_text = true, |
| 1428 | -- pattern = "*", | 1428 | }, |
| 1429 | -- callback = function(args) | 1429 | }) |
| 1430 | -- local map = vim.api.nvim_buf_set_keymap | 1430 | vim.api.nvim_create_autocmd("LspAttach", { |
| 1431 | -- map(0, "n", "gd", "<cmd>Lspsaga goto_definition<cr>", { silent = true, noremap = true }) | 1431 | group = custom_autocommands, |
| 1432 | -- map(0, "n", "gR", "<cmd>Lspsaga rename<cr>", { silent = true, noremap = true }) | 1432 | pattern = "*", |
| 1433 | -- map(0, "n", "gx", "<cmd>Lspsaga code_action<cr>", { silent = true, noremap = true }) | 1433 | callback = function(args) |
| 1434 | -- map(0, "x", "gx", ":<c-u>Lspsaga range_code_action<cr>", { silent = true, noremap = true }) | 1434 | local map = vim.api.nvim_buf_set_keymap |
| 1435 | -- map(0, "n", "K", "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true }) | 1435 | map(0, "n", "gd", "<cmd>Lspsaga goto_definition<cr>", { silent = true, noremap = true }) |
| 1436 | -- map(0, "n", "go", "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true }) | 1436 | map(0, "n", "gR", "<cmd>Lspsaga rename<cr>", { silent = true, noremap = true }) |
| 1437 | -- map(0, "n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", { silent = true, noremap = true }) | 1437 | map(0, "n", "gx", "<cmd>Lspsaga code_action<cr>", { silent = true, noremap = true }) |
| 1438 | -- map(0, "n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", { silent = true, noremap = true }) | 1438 | map(0, "x", "gx", ":<c-u>Lspsaga range_code_action<cr>", { silent = true, noremap = true }) |
| 1439 | -- | 1439 | map(0, "n", "K", "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true }) |
| 1440 | -- -- Don't know why... Everytime when modeline is set and insert a single char | 1440 | map(0, "n", "go", "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true }) |
| 1441 | -- -- while inside a fold, the fold closes. | 1441 | map(0, "n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", { silent = true, noremap = true }) |
| 1442 | -- vim.opt_local.modeline = false | 1442 | map(0, "n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", { silent = true, noremap = true }) |
| 1443 | -- end, | 1443 | |
| 1444 | -- }) | 1444 | -- Don't know why... Everytime when modeline is set and insert a single char |
| 1445 | -- end | 1445 | -- while inside a fold, the fold closes. |
| 1446 | -- }, | 1446 | vim.opt_local.modeline = false |
| 1447 | -- -- }}} | 1447 | end, |
| 1448 | }) | ||
| 1449 | end | ||
| 1450 | }, | ||
| 1451 | -- }}} | ||
| 1448 | -- -- conform {{{ | 1452 | -- -- conform {{{ |
| 1449 | -- { | 1453 | -- { |
| 1450 | -- "stevearc/conform.nvim", | 1454 | -- "stevearc/conform.nvim", |