From 7e6bfc2f4d51c39b8cee5b78c3764231784a2cbe Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 22 Sep 2021 05:52:26 +0200 Subject: [PATCH] Feat: clean vim scripts --- nvim/.config/nvim/general/completion.vim | 18 ---- nvim/.config/nvim/general/mappings.vim | 19 ----- nvim/.config/nvim/general/settings.vim | 69 ---------------- nvim/.config/nvim/plugins/lightline.vim | 10 --- nvim/.config/nvim/plugins/nvim-comp.vim | 101 ----------------------- nvim/.config/nvim/plugins/plugins.vim | 48 ----------- nvim/.config/nvim/plugins/vimtex.vim | 25 ------ 7 files changed, 290 deletions(-) delete mode 100644 nvim/.config/nvim/general/completion.vim delete mode 100644 nvim/.config/nvim/general/mappings.vim delete mode 100644 nvim/.config/nvim/general/settings.vim delete mode 100644 nvim/.config/nvim/plugins/lightline.vim delete mode 100644 nvim/.config/nvim/plugins/nvim-comp.vim delete mode 100644 nvim/.config/nvim/plugins/plugins.vim delete mode 100644 nvim/.config/nvim/plugins/vimtex.vim diff --git a/nvim/.config/nvim/general/completion.vim b/nvim/.config/nvim/general/completion.vim deleted file mode 100644 index 0b6edda..0000000 --- a/nvim/.config/nvim/general/completion.vim +++ /dev/null @@ -1,18 +0,0 @@ -" Use completion-nvim in every buffer -autocmd BufEnter * lua require'nvim-comp'.on_attach() - -let g:completion_enable_snippet = 'UltiSnips' -let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] - -" Use and to navigate through popup menu -" inoremap pumvisible() ? "\" : "\" -" inoremap pumvisible() ? "\" : "\" - -"map to manually trigger completion -"imap (completion_trigger) - -" Set completeopt to have a better completion experience -set completeopt=menuone,noinsert,noselect - -" Avoid showing message extra message when using completion -set shortmess+=c diff --git a/nvim/.config/nvim/general/mappings.vim b/nvim/.config/nvim/general/mappings.vim deleted file mode 100644 index d9453b9..0000000 --- a/nvim/.config/nvim/general/mappings.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Better window navigation -" nnoremap h -" nnoremap j -" nnoremap k -" nnoremap l - -" Align blocks of text and keep them selected -vmap < >gv - -" Automatically spell check last error in insert mode -inoremap u[s1z=`]au - -" Find files using Telescope command-line sugar. -nnoremap e Telescope find_files -nnoremap g Telescope live_grep -nnoremap b Telescope buffers -nnoremap h Telescope help_tags - diff --git a/nvim/.config/nvim/general/settings.vim b/nvim/.config/nvim/general/settings.vim deleted file mode 100644 index 09c2870..0000000 --- a/nvim/.config/nvim/general/settings.vim +++ /dev/null @@ -1,69 +0,0 @@ -" set leader key -let g:mapleader = "\" - -syntax enable " Enables syntax highlighing -set hidden " Required to keep multiple buffers open multiple buffers -set wrap " Display long lines as just one line -set pumheight=10 " Makes popup menu smaller -set encoding=utf-8 " The encoding displayed -set fileencoding=utf-8 " The encoding written to file -set ruler " Show the cursor position all the time -set cmdheight=1 " More space for displaying messages -set iskeyword+=- " treat dash separated words as a word text object" -set mouse=a " Enable your mouse -set t_Co=256 " Support 256 colors - -set conceallevel=0 " So that I can see `` in markdown files -set tabstop=4 " Insert 2 spaces for a tab -set shiftwidth=4 " Change the number of space characters inserted for indentation -set smarttab " Makes tabbing smarter will realize you have 2 vs 4 -set expandtab " Converts tabs to spaces -set smartindent " Makes indenting smart -set autoindent " Good auto indent -set foldmethod=indent - -set laststatus=2 " Always display the status line - -set number " Line number -set relativenumber " Relative line number -set cursorline " Enable highlighting of the current line -set showtabline=1 " show tabs only when there are some - -set background=dark " tell vim what the background color looks like - -set nobackup " This is recommended by coc -set nowritebackup " This is recommended by coc -set noswapfile - -set updatetime=300 " Faster completion -set timeoutlen=500 " By default timeoutlen is 1000 ms - -set clipboard=unnamedplus " Copy paste between vim and everything else - -set showmode " Display edition mode -"set noshowmode " We don't need to see things like -- INSERT -- anymore - -set incsearch " hightlight while searching -set ignorecase " Ignore case while searching -set smartcase " Override ignorecase if search patern contains upper case -set wildmenu " Enable wildmenu - -set spell " Enable spell checking -set spelllang=fr,en - -set nrformats+=alpha " letter concidered as number for Ctrl-A or Ctrl-X - -"set autochdir " Your working directory will always be the same as your working directory - -execute "set colorcolumn=" . join(range(81,335), ',') - -colorscheme zenburn - -" Set completeopt to have a better completion experience -" set completeopt=menuone,noinsert,noselect -" set completeopt=menuone,noselect - -" Avoid showing message extra message when using completion -set shortmess+=c - -let g:indentLine_setConceal = 0 diff --git a/nvim/.config/nvim/plugins/lightline.vim b/nvim/.config/nvim/plugins/lightline.vim deleted file mode 100644 index 328e353..0000000 --- a/nvim/.config/nvim/plugins/lightline.vim +++ /dev/null @@ -1,10 +0,0 @@ -let g:lightline = { - \ 'colorscheme': 'wombat', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'gitbranch', 'readonly', 'relativepath', 'modified'] ] - \ }, - \ 'component_function': { - \ 'gitbranch': 'FugitiveHead' - \ }, - \ } diff --git a/nvim/.config/nvim/plugins/nvim-comp.vim b/nvim/.config/nvim/plugins/nvim-comp.vim deleted file mode 100644 index c3cc1bd..0000000 --- a/nvim/.config/nvim/plugins/nvim-comp.vim +++ /dev/null @@ -1,101 +0,0 @@ -let g:compe = {} -let g:compe.enabled = v:true -let g:compe.autocomplete = v:true -let g:compe.debug = v:false -let g:compe.min_length = 1 -let g:compe.preselect = 'enable' -let g:compe.throttle_time = 80 -let g:compe.source_timeout = 200 -let g:compe.resolve_timeout = 800 -let g:compe.incomplete_delay = 400 -let g:compe.max_abbr_width = 100 -let g:compe.max_kind_width = 100 -let g:compe.max_menu_width = 100 -let g:compe.documentation = v:true - -let g:compe.source = {} -let g:compe.source.path = v:true -let g:compe.source.buffer = v:true -let g:compe.source.calc = v:true -let g:compe.source.nvim_lsp = v:true -let g:compe.source.nvim_lua = v:true -let g:compe.source.vsnip = v:true -let g:compe.source.ultisnips = v:true -let g:compe.source.luasnip = v:true -let g:compe.source.emoji = v:false - -" NOTE: You can use other key to expand snippet. - - -" Expand -imap vsnip#expandable() ? '(vsnip-expand)' : '' -smap vsnip#expandable() ? '(vsnip-expand)' : '' - -" Expand or jump -imap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' -smap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' - -" Jump forward or backward -imap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' -smap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' -imap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' -smap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' - -" Select or cut text to use as $TM_SELECTED_TEXT in the next snippet. -" See https://github.com/hrsh7th/vim-vsnip/pull/50 -nmap s (vsnip-select-text) -xmap s (vsnip-select-text) -nmap S (vsnip-cut-text) -xmap S (vsnip-cut-text) - -" " If you want to use snippet for multiple filetypes, you can `g:vsnip_filetypes` for it. -" let g:vsnip_filetypes = {} -" let g:vsnip_filetypes.javascriptreact = ['javascript'] -" let g:vsnip_filetypes.typescriptreact = ['typescript'] - -lua << EOF -local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) -end - -local check_back_space = function() - local col = vim.fn.col('.') - 1 - if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - return true - else - return false - end -end - --- Use (s-)tab to: ---- move to prev/next item in completion menuone ---- jump to prev/next snippet's placeholder -_G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif check_back_space() then - return t "" - else - return vim.fn['compe#complete']() - end -end -_G.s_tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - else - return t "" - end -end - -vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) - ---This line is important for auto-import -vim.api.nvim_set_keymap('i', '', 'compe#confirm("")', { expr = true }) -vim.api.nvim_set_keymap('i', '', 'compe#complete()', { expr = true }) -EOF - -let g:vsnip_snippet_dir = expand('~/.config/nvim/vsnips') - diff --git a/nvim/.config/nvim/plugins/plugins.vim b/nvim/.config/nvim/plugins/plugins.vim deleted file mode 100644 index 3fa20ed..0000000 --- a/nvim/.config/nvim/plugins/plugins.vim +++ /dev/null @@ -1,48 +0,0 @@ -" auto-install vim-plug -if empty(glob('~/.config/nvim/autoload/plug.vim')) - silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - "autocmd VimEnter * PlugInstall - "autocmd VimEnter * PlugInstall | source $MYVIMRC -endif - -call plug#begin('~/.config/nvim/autoload/plugged') - - Plug 'jnurmine/Zenburn' - Plug 'itchyny/lightline.vim' - - "Plug 'tpope/vim-sensible' - Plug 'tpope/vim-fugitive' - Plug 'mhinz/vim-signify' - Plug 'tpope/vim-surround' - Plug 'tpope/vim-repeat' - - Plug 'junegunn/goyo.vim' - Plug 'christoomey/vim-tmux-navigator' - Plug 'Yggdroot/indentLine' - - " Plug 'SirVer/ultisnips' - " Plug 'honza/vim-snippets' - Plug 'neovim/nvim-lspconfig' - Plug 'hrsh7th/nvim-compe' - Plug 'hrsh7th/vim-vsnip' - Plug 'hrsh7th/vim-vsnip-integ' - Plug 'rafamadriz/friendly-snippets' - - " Plug 'nvim-lua/completion-nvim' - - Plug 'nvim-lua/popup.nvim' - Plug 'nvim-lua/plenary.nvim' - Plug 'nvim-telescope/telescope.nvim' - - Plug 'lervag/vimtex' - - " Highlight on Yank - Plug 'machakann/vim-highlightedyank' - " Autoclose parenthesis - " Plug 'cohama/lexima.vim' - Plug 'jiangmiao/auto-pairs' - - " Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} - -call plug#end() diff --git a/nvim/.config/nvim/plugins/vimtex.vim b/nvim/.config/nvim/plugins/vimtex.vim deleted file mode 100644 index 210236f..0000000 --- a/nvim/.config/nvim/plugins/vimtex.vim +++ /dev/null @@ -1,25 +0,0 @@ -let maplocalleader = "\" - -let g:tex_conceal = "" -set conceallevel=0 - -let g:vimtex_compiler_latexmk = { - \ 'backend' : 'nvim', - \ 'background' : 1, - \ 'build_dir' : '', - \ 'callback' : 0, - \ 'continuous' : 1, - \ 'options' : [ - \ '-pdf', - \ '-verbose', - \ '-file-line-error', - \ '-synctex=1', - \ '-interaction=nonstopmode', - \ '-silent', - \ '-shell-escape', - \ ], - \} -let g:vimtex_view_method = 'zathura' - -" Les fichiers sty et cls sont vus comme des fichiers tex -autocmd BufRead,BufNewFile *.{sty,cls} setlocal syntax=tex