vim: add vim-visual-multi plugin for multiple cursors

This commit is contained in:
Fernando Schauenburg 2022-10-05 14:35:16 +02:00
parent 861c13b7bd
commit c4495a5e6c
3 changed files with 13 additions and 3 deletions

View file

@ -25,6 +25,6 @@ plugin.setup {
},
}
vim.keymap.set('n', '<c-n>', '<cmd>NvimTreeToggle<cr>')
vim.keymap.set('n', '<leader>n', '<cmd>NvimTreeFindFileToggle<cr>')
vim.keymap.set('n', '<leader>tt', '<cmd>NvimTreeToggle<cr>')
vim.keymap.set('n', '<leader>tf', '<cmd>NvimTreeFindFileToggle<cr>')

View file

@ -122,6 +122,12 @@ local parts = {
end
},
visual_multi = function()
local ok, infos = pcall(vim.fn.VMInfos)
if not ok or not infos.status then return '' end
return infos.current .. '/' .. infos.total .. ' ' .. infos.status
end,
branch = {
'branch',
icon = '',
@ -185,7 +191,7 @@ local parts = {
local sections = Table:new {
lualine_a = {},
lualine_b = {},
lualine_b = { parts.visual_multi },
lualine_c = { parts.branch, parts.diff, parts.split, parts.path },
lualine_x = { 'diagnostics', parts.filetype, parts.fileformat, parts.progress },
lualine_y = { parts.location },

View file

@ -17,6 +17,9 @@ vim.g.better_whitespace_filetypes_blacklist = {
vim.g.vim_json_syntax_conceal = 0 -- Disable quote concealling.
vim.g.VM_leader = '\\'
vim.g.VM_silent_exit = 1
return packer().startup(function(use)
use 'wbthomason/packer.nvim'
use 'nvim-lua/plenary.nvim'
@ -37,6 +40,7 @@ return packer().startup(function(use)
use 'ntpeters/vim-better-whitespace'
use 'godlygeek/tabular'
use 'tpope/vim-commentary'
use 'mg979/vim-visual-multi'
-- git --------------------------------------------------------------------
use 'tpope/vim-fugitive'