mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat(nvim): replace tabular with mini.align
This commit is contained in:
2
nvim/after/plugin/mini.lua
Normal file
2
nvim/after/plugin/mini.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
-- https://github.com/echasnovski/mini.nvim
|
||||
require("mini.align").setup()
|
||||
@@ -1,21 +0,0 @@
|
||||
" https://github.com/godlygeek/tabular
|
||||
|
||||
" Custom Tabular Commands
|
||||
AddTabularPattern! equals /^[^=]*\zs=/
|
||||
AddTabularPattern! ruby_hash /^[^=>]*\zs=>/
|
||||
AddTabularPattern! commas /,\s*\zs\s/l0
|
||||
AddTabularPattern! colons /^[^:]*:\s*\zs\s/l0
|
||||
|
||||
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
|
||||
|
||||
" Automatic Tabular.vim with the (|)
|
||||
function! s:align()
|
||||
let p = '^\s*|\s.*\s|\s*$'
|
||||
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
|
||||
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
|
||||
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
|
||||
Tabularize/|/l1
|
||||
normal! 0
|
||||
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
||||
endif
|
||||
endfunction
|
||||
@@ -158,7 +158,6 @@ return packer.startup(function(use)
|
||||
use("mattn/emmet-vim") -- Emmet
|
||||
use("editorconfig/editorconfig-vim") -- Editorconfig
|
||||
use("sheerun/vim-polyglot") -- A collection of language packs (?)
|
||||
use("godlygeek/tabular") -- Align everything
|
||||
use("tpope/vim-abolish") -- Autofix spelling mistakes
|
||||
use("mg979/vim-visual-multi") -- Multi cursor mode
|
||||
use("vim-scripts/VisIncr") -- Increase and decreasing numbers, dates, daynames etc.
|
||||
@@ -177,6 +176,7 @@ return packer.startup(function(use)
|
||||
use("folke/todo-comments.nvim") -- Highlight TODO
|
||||
use("DNLHC/glance.nvim") -- Pretty preview of LSP locations
|
||||
use("rlane/pounce.nvim") -- Incremental fuzzy search motion
|
||||
use("echasnovski/mini.nvim") -- Library with 20+ plugins
|
||||
|
||||
-- Custom Text Objects
|
||||
use("christoomey/vim-titlecase")
|
||||
|
||||
Reference in New Issue
Block a user