From 882970ebb3951d2a6ec1a702a598990d831abcc1 Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:35:32 +0200 Subject: [PATCH] change gitattributes and readme --- .gitattributes | 2 +- README.md | 6 ++-- neovim/neovim.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 neovim/neovim.md diff --git a/.gitattributes b/.gitattributes index c10cb9b..171c31e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -neovim/** gitlab-language=vim +neovim/*.conf gitlab-language=vim diff --git a/README.md b/README.md index 2c20104..18d1d9e 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ You can also put the conf inside the actual path ## Syntax highlighting In order to display the proper syntax highlighting on Gitlab, -edit the .gitattribute file accordingly: \ +edit the .gitattributes file accordingly: \ ```txt -neovim/** gitlab-language=vim -spacemacs/** gitlab-language=elisp +neovim/*.conf gitlab-language=vim +spacemacs/*.conf gitlab-language=elisp ``` diff --git a/neovim/neovim.md b/neovim/neovim.md new file mode 100644 index 0000000..55c3ecc --- /dev/null +++ b/neovim/neovim.md @@ -0,0 +1,83 @@ +set nocompatible " Required to read a vim (not vi) config correctly +set completeopt=preview " Completation mode: preview + +" Vim-airline settings +let g:airline_powerline_fonts = 1 +let g:airline#extensions#tabline#enabled = 1 +let g:airline_theme='term' +let g:airline#extensions#whitespace#enabled = 0 + +" Python settings +let g:python3_host_prog = '/usr/bin/python3.9' +let g:loaded_python_provider = 0 + + +" Default 4 tab spaces +set tabstop=4 +set shiftwidth=4 +set expandtab +" change it based on filetype +autocmd Filetype ruby setlocal ts=2 sw=2 +autocmd Filetype slim setlocal ts=2 sw=2 + +" set cindent +set encoding=utf-8 +set nu +set hidden +set noshowmode +" Disabling backups and swap files (cause problem in servers, messy dirs etc.) +" You might want to comment this if you are on an unstable system +set nobackup +set nowritebackup +set noswapfile + +" Use Ctrl+Q to close buffer +noremap :bd +" Map Ctrl+N for NerdTree +map :NERDTreeToggle +inoremap pumvisible() ? "\" : "\" +" Map ; to search files (fd) +map ; :Files +" Map , to match in files (ripgrep) +map ' :Rg +" Map /ln to disable highlighting +nmap ln :noh +" Windows splitting and movement (move windows with hjkl keys) +function! WinMove(key) + let t:curwin = winnr() + exec "wincmd ".a:key + if (t:curwin == winnr()) + if (match(a:key,'[jk]')) + wincmd v + else + wincmd s + endif + exec "wincmd ".a:key + endif +endfunction + +nnoremap :call WinMove('h') +nnoremap :call WinMove('j') +nnoremap :call WinMove('k') +nnoremap :call WinMove('l') + + +" Using Plug for plugins +call plug#begin('~/.vim/plugged') + +Plug 'preservim/nerdtree' " NerdTree for browsing directories +Plug 'neoclide/coc.nvim', { 'branch': 'release' } " CoC for completion, works similar to VSCode +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Fuzzy finder +Plug 'junegunn/fzf.vim' +Plug 'vim-airline/vim-airline' " Status/tabline for vim +Plug 'vim-airline/vim-airline-themes' +Plug 'jiangmiao/auto-pairs' " Brackets management plugins +Plug 'machakann/vim-sandwich' +Plug 'airblade/vim-gitgutter' " Git plugin + +call plug#end() + + +filetype plugin indent on +syntax enable +