2
0
mirror of https://github.com/webgefrickel/dotfiles synced 2024-11-11 07:10:40 +00:00

More oldschool-plugin for vim removal

This commit is contained in:
Steffen Rademacker 2022-01-03 23:27:10 +01:00
parent 708189e736
commit 536c320b4f
5 changed files with 47 additions and 46 deletions

View File

@ -1,4 +1,4 @@
require'colorizer'.setup({
require('colorizer').setup({
'css';
'scss';
'json';

View File

@ -0,0 +1,4 @@
require('surround').setup({
mappings_style = 'surround'
})

View File

@ -26,4 +26,20 @@ require('nvim-treesitter.configs').setup({
indent = {
enable = true,
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['ab'] = '@block.outer',
['ib'] = '@block.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@call.outer',
['ic'] = '@call.inner',
['ai'] = '@conditional.outer',
['ii'] = '@conditional.inner',
},
},
},
})

View File

@ -12,9 +12,6 @@ local map = function(mode, lhs, rhs, opts)
}))
end
-- Part 1: override vim-behaviour with saner config
---------------------------------------------------
-- remap semi-colon to be colon in normal an visual mode
map('n', ';', ':')
map('v', ';', ':')
@ -49,37 +46,22 @@ map('i', '.', '.<c-g>u')
map('i', '!', '!<c-g>u')
map('i', '?', '?<c-g>u')
-- Part 2: better simpler shortcuts
-----------------------------------
-- bubbling of lines/selections using unimpaired mappings
-- alt + hjkl, no remapping of alt/esc-+ in iterm2
map('n', '˚', '[e', { noremap = false })
map('n', '', ']e', { noremap = false })
-- bubbling of lines/selections with alt + hjkl
map('n', '˚', ':move .-2<cr>', { noremap = false })
map('n', '', ':move .+1<cr>', { noremap = false })
map('n', '˙', '<<', { noremap = false })
map('n', '¬', '>>', { noremap = false })
map('v', '˚', '[egv', { noremap = false })
map('v', '', ']egv', { noremap = false })
map('v', '˚', ":move '<-2<cr>gv", { noremap = false })
map('v', '', ":move '>+1<cr>gv", { noremap = false })
map('v', '˙', '<gv', { noremap = false })
map('v', '¬', '>gv', { noremap = false })
-- reload files and redraw with f5
map('n', '<F5>', '<cmd>checktime<cr><cmd>redraw!<cr>');
-- use the arrowkeys for usefull stuff in normal mode -- switching buffers
map('n', '<up>', '<cmd>bfirst<cr>')
map('n', '<down>', '<cmd>blast<cr>')
map('n', '<left>', '<cmd>bp<cr>')
map('n', '<right>', '<cmd>bn<cr>')
-- lsp shortcuts
map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
-- Parts 3: leader-key mappings
-------------------------------
-- easieser splits
map('n', '<leader>\\', '<C-w>v<C-w>l')
map('n', '<leader>-', '<C-w>s<C-w>j')
@ -96,6 +78,9 @@ map('n', '<leader>c', '<cmd>lua require("fzf-lua").git_commits()<cr>')
map('n', '<leader>]', '<cmd>lua require("fzf-lua").lines()<cr>')
-- lsp and diagnostics
map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
map('n', '<leader>d', '<cmd>lua vim.lsp.buf.declaration()<cr>')
map('n', '<leader>e', '<cmd>lua vim.diagnostic.goto_next()<cr>')
map('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting()<cr>')
@ -104,27 +89,24 @@ map('n', '<leader>r', '<cmd>lua vim.lsp.buf.rename()<cr>')
map('n', '<leader>x', '<cmd>lua vim.lsp.buf.code_action()<cr>')
-- git
map('n', '<leader>gb', '<cmd>Git blame<cr><C-w>10+')
map('n', '<leader>gc', '<cmd>Git commit<cr><C-w>10+')
map('n', '<leader>l', '<cmd>FloatermNew lazygit<cr>')
map('n', '<leader>gd', '<cmd>DiffviewOpen<cr>')
map('n', '<leader>gc', '<cmd>DiffviewClose<cr>')
map('n', '<leader>gh', '<cmd>DiffviewFileHistory<cr>')
map('n', '<leader>gf', '/\\v^[<\\|=>]{7}( .*\\|$)<cr>')
map('n', '<leader>gs', '<cmd>G<cr><C-w>10+')
map('n', '<leader>gw', '<cmd>Gwrite<cr><C-w>10+')
-- floaterm
map('n', '-', '<cmd>FloatermNew nnn<cr>')
map('n', '<leader>t', '<cmd>FloatermNew<cr>')
map('n', '<leader>l', '<cmd>FloatermNew lazygit<cr>')
-- vsnip snippets expansion
map('i', '<C-j>', 'vsnip#available(1) ? "<Plug>(vsnip-expand-or-jump)" : "<C-j>"', { expr = true, noremap = false })
map('s', '<C-j>', 'vsnip#available(-1) ? "<Plug>(vsnip-jump-prev)" : "<C-j>"', { expr = true, noremap = false
})
-- other tools and plugins
-- other useful mappings
map('n', '<F5>', '<cmd>checktime<cr><cmd>redraw!<cr>');
map('n', '<leader>j', '<cmd>lua require("hop").hint_words()<cr>')
-- custom handy shortcuts
map('n', '<leader>ve', '<cmd>e $MYVIMRC<cr>')
map('n', '<leader>vr', '<cmd>source $MYVIMRC<cr>')
map('n', '<leader>w', '<cmd>set wrap! wrap?<cr>')

View File

@ -2,7 +2,7 @@ local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
function get_config(name)
return string.format("require(\"config/%s\")", name)
return string.format('require("config/%s")', name)
end
-- bootstrapping / downloading packer. run :PackerSync afterwards if sth. fails
@ -23,13 +23,6 @@ return require('packer').startup(function(use)
-- oldschool vimscript plugins, that still provide a lot of value
use 'christoomey/vim-tmux-navigator'
use 'editorconfig/editorconfig-vim'
use 'tpope/vim-apathy'
use 'tpope/vim-fugitive' -- replace with? sindrets/diffview.nvim
use 'tpope/vim-ragtag' -- debate if we still need the next tpope-plugins
use 'tpope/vim-repeat'
use 'tpope/vim-surround'
use 'tpope/vim-unimpaired'
use 'wellle/targets.vim'
use 'wincent/terminus'
-- floating-terminal integration for nnn, lazygit etc.
@ -46,8 +39,8 @@ return require('packer').startup(function(use)
-- colorizer for nice css-colors
use {
"norcalli/nvim-colorizer.lua",
event = "BufReadPre",
'norcalli/nvim-colorizer.lua',
event = 'BufReadPre',
config = get_config('colorizer'),
}
@ -55,9 +48,15 @@ return require('packer').startup(function(use)
use {
'nvim-treesitter/nvim-treesitter',
config = get_config('treesitter'),
run = ":TSUpdate",
run = ':TSUpdate',
}
-- textobjects, surroung, for stuff like cs", cib etc.
use 'nvim-treesitter/nvim-treesitter-textobjects'
use {
'blackCauldron7/surround.nvim',
config = get_config('surround'),
}
-- fzf integration
use {
@ -81,8 +80,8 @@ return require('packer').startup(function(use)
-- commenting stuff out
use {
"numToStr/Comment.nvim",
config = get_config("comment")
'numToStr/Comment.nvim',
config = get_config('comment')
}
-- nice status line
@ -124,7 +123,7 @@ return require('packer').startup(function(use)
use {
'phaazon/hop.nvim',
config = get_config('hop'),
event = "BufReadPre",
event = 'BufReadPre',
}
-- colorscheme