From 10de9e37c33ac82ab4fdbfe33b7405cf4c84c5c9 Mon Sep 17 00:00:00 2001 From: navewindre Date: Wed, 11 Sep 2024 18:10:13 +0200 Subject: v2 --- vimrc | 379 +++++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 247 insertions(+), 132 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 0259cbe..1909822 100644 --- a/vimrc +++ b/vimrc @@ -1,109 +1,54 @@ set autoindent expandtab tabstop=2 shiftwidth=2 number set mouse=a +set mousemodel=popup set noshowmode set termguicolors set title set smartcase +set showtabline=2 +set nocompatible filetype plugin on -let g:lightline = { - \ 'colorscheme': 'landscape', - \ } - -call plug#begin() - -Plug 'chriskempson/base16-vim' -Plug 'neovim/nvim-lspconfig' -Plug 'hrsh7th/cmp-nvim-lsp' -Plug 'hrsh7th/cmp-buffer' -Plug 'hrsh7th/cmp-path' -Plug 'hrsh7th/cmp-cmdline' -Plug 'hrsh7th/nvim-cmp' -Plug 'itchyny/lightline.vim' -Plug 'shawnohare/hadalized.nvim' -Plug 'preservim/nerdtree' -Plug 'bignimbus/pop-punk.vim' -Plug 'romgrk/barbar.nvim' -Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} -Plug 'nvim-lua/plenary.nvim' -Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' } -Plug 'hrsh7th/cmp-vsnip' -Plug 'hrsh7th/vim-vsnip' -Plug 'TabbyML/vim-tabby' -Plug 'Yggdroot/indentLine' -Plug 'johnfrankmorgan/whitespace.nvim' - -let g:tabby_keybinding_accept = '' - -call plug#end() - -function! SW() - if winnr('$') > 1 - wincmd w - else - BufferNext - endif -endfunction - -function! Q() - if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1 - NERDTreeClose - else - if winnr('$') > 1 - q - else - let buffers = filter(range(1, bufnr('$')), 'buflisted(v:val)') - if len(buffers) > 1 - BufferClose - else - call feedkeys(':q') - endif - endif - endif -endfunction - -nnoremap :NERDTree -inoremap :NERDTree -vnoremap :NERDTree - -nnoremap :call Q() -nnoremap :call SW() -nnoremap :BufferNext - -nnoremap :BufferPick -inoremap :BufferPick -vnoremap :BufferPick - -nnoremap :Telescope live_grep -nnoremap :Telescope current_buffer_fuzzy_find - -nnoremap :lua ToggleDiagnostics() - -vnoremap >gv -nnoremap -vnoremap Advanced Setup) -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! - highlight = { enable = true, - - -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to - -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is - -- the name of the parser) - -- list of language that will be disabled - -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files disable = function(lang, buf) local max_filesize = 100 * 1024 -- 100 KB local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) @@ -248,13 +174,202 @@ lua < 1 + wincmd w + else + tabnext + endif +endfunction + +function! Q() + if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1 + NERDTreeClose + else + if winnr('$') > 1 + q + else + call feedkeys(':q') + endif + endif +endfunction + +function! GoToTab(tab_number) + execute 'tabn ' . a:tab_number +endfunction + + +function! InputTabNumber() + let l:tab_number = nr2char(getchar()) + if l:tab_number =~ '\d' + call GoToTab(str2nr(l:tab_number)) + endif +endfunction + +nnoremap :NERDTree +inoremap :NERDTree +vnoremap :NERDTree + +nnoremap :call Q() +nnoremap :call SW() + +nnoremap :call InputTabNumber() +inoremap :call InputTabNumber() +vnoremap :call InputTabNumber() + +nnoremap :Telescope live_grep +nnoremap :Telescope current_buffer_fuzzy_find + +nnoremap :lua ToggleDiagnostics() + +vnoremap >gv +nnoremap +vnoremap