From d15be92b25666d5f13dbdcea65c0cfc515e70fbb Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Fri, 9 Apr 2021 18:30:52 +0200 Subject: [PATCH 01/14] Neovim config --- .config/nvim/init.vim | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .config/nvim/init.vim diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..3f52948 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,62 @@ +" Python settings +let g:python3_host_prog = '/usr/bin/python3.9' +let g:loaded_python_provider = 0 + +" 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 + +" Go settings +let g:deoplete#sources#go#gocode_binary = '~/.local/share/go/bin/gocode' " Path for gocode binary, check your $GOPATH folder +let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const'] " Completion order list + +" Rust settings +let g:deoplete#sources#rust#racer_binary = '~/.cargo/bin/racer' " Path for racer binary +let g:deoplete#sources#rust#rust_source_path='~./local/share/rustsrc' " Path for rust source + +set nocompatible " Required to read a vim (not vi) config correctly +set completeopt=preview " Completation mode: preview +let g:deoplete#enable_at_startup = 1 " Enable deoplete + +" 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 + +" Use Ctrl+Q to close buffer +noremap :bd +" Map Ctrl+N for NerdTree +map :NERDTreeToggle +inoremap pumvisible() ? "\" : "\" + +" Using Plug for plugins +call plug#begin('~/.vim/plugged') + +Plug 'preservim/nerdtree' " NerdTree for browsing directories +Plug 'Shougo/deoplete.nvim' " Deoplete for auto completation +Plug 'ctrlpvim/ctrlp.vim' " File finder +Plug 'vim-airline/vim-airline-themes' " Status/tabline for vim +Plug 'vim-airline/vim-airline' +Plug 'deoplete-plugins/deoplete-jedi' " Deoplete Python completion +" Deoplete Go completion +" gocode is needed: go get -u github.com/stamblerre/gocode +Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'} +" Deoplete Rust completion +" racer is needed: cargo install racer (you might need nightly rust) +Plug 'sebastianmarkow/deoplete-rust' +call plug#end() + +filetype plugin indent on +syntax enable + From fa19322a73679285b563b926622b7e2aab7e54da Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 12:13:44 +0200 Subject: [PATCH 02/14] use naming system instead of .config --- .config/nvim/init.vim => neovim.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .config/nvim/init.vim => neovim.conf (100%) diff --git a/.config/nvim/init.vim b/neovim.conf similarity index 100% rename from .config/nvim/init.vim rename to neovim.conf From e1f0e1845f4dfa609060e30d3fd5f07d3e963135 Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 13:50:56 +0200 Subject: [PATCH 03/14] update nvim conf, dir management --- neovim.conf | 62 --------------------------------- neovim/nvim-conf.vim | 83 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 62 deletions(-) delete mode 100644 neovim.conf create mode 100644 neovim/nvim-conf.vim diff --git a/neovim.conf b/neovim.conf deleted file mode 100644 index 3f52948..0000000 --- a/neovim.conf +++ /dev/null @@ -1,62 +0,0 @@ -" Python settings -let g:python3_host_prog = '/usr/bin/python3.9' -let g:loaded_python_provider = 0 - -" 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 - -" Go settings -let g:deoplete#sources#go#gocode_binary = '~/.local/share/go/bin/gocode' " Path for gocode binary, check your $GOPATH folder -let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const'] " Completion order list - -" Rust settings -let g:deoplete#sources#rust#racer_binary = '~/.cargo/bin/racer' " Path for racer binary -let g:deoplete#sources#rust#rust_source_path='~./local/share/rustsrc' " Path for rust source - -set nocompatible " Required to read a vim (not vi) config correctly -set completeopt=preview " Completation mode: preview -let g:deoplete#enable_at_startup = 1 " Enable deoplete - -" 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 - -" Use Ctrl+Q to close buffer -noremap :bd -" Map Ctrl+N for NerdTree -map :NERDTreeToggle -inoremap pumvisible() ? "\" : "\" - -" Using Plug for plugins -call plug#begin('~/.vim/plugged') - -Plug 'preservim/nerdtree' " NerdTree for browsing directories -Plug 'Shougo/deoplete.nvim' " Deoplete for auto completation -Plug 'ctrlpvim/ctrlp.vim' " File finder -Plug 'vim-airline/vim-airline-themes' " Status/tabline for vim -Plug 'vim-airline/vim-airline' -Plug 'deoplete-plugins/deoplete-jedi' " Deoplete Python completion -" Deoplete Go completion -" gocode is needed: go get -u github.com/stamblerre/gocode -Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'} -" Deoplete Rust completion -" racer is needed: cargo install racer (you might need nightly rust) -Plug 'sebastianmarkow/deoplete-rust' -call plug#end() - -filetype plugin indent on -syntax enable - diff --git a/neovim/nvim-conf.vim b/neovim/nvim-conf.vim new file mode 100644 index 0000000..55c3ecc --- /dev/null +++ b/neovim/nvim-conf.vim @@ -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 + From eba1ccbc69c68a0ba9c2609c47ba918ce6172339 Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:04:40 +0200 Subject: [PATCH 04/14] gitattribute --- .gitattributes | 1 + neovim/nvim-conf.vim | 83 -------------------------------------------- 2 files changed, 1 insertion(+), 83 deletions(-) create mode 100644 .gitattributes delete mode 100644 neovim/nvim-conf.vim diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c10cb9b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +neovim/** gitlab-language=vim diff --git a/neovim/nvim-conf.vim b/neovim/nvim-conf.vim deleted file mode 100644 index 55c3ecc..0000000 --- a/neovim/nvim-conf.vim +++ /dev/null @@ -1,83 +0,0 @@ -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 - From 47baaa82a8850a434018d32c48c5a80f4a9e9964 Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:04:58 +0200 Subject: [PATCH 05/14] rename file --- neovim/neovim.conf | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 neovim/neovim.conf diff --git a/neovim/neovim.conf b/neovim/neovim.conf new file mode 100644 index 0000000..55c3ecc --- /dev/null +++ b/neovim/neovim.conf @@ -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 + From 5d0eeb22923b46c49e26c8ce429c662f6f0dcd3f Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:24:53 +0200 Subject: [PATCH 06/14] edit readme --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ca999b..6d3da0a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ # dot-files -Unitoo standardized dotfiles. \ No newline at end of file +Unitoo standardized dotfiles. + +## Directory Logic + +The directory tree logic is the following: program_name/program_name.conf and +eventually an associated Markdown file program_name/program_name.md \ +OR program_name/path/to/conf/program_name.conf + && program_name/path/to/conf/program_name.conf \ +**Examples:** neovim/neovim.conf, nginx/etc/nginx/nginx.conf + +## Syntax highlighting + +To let Gitlab display the proper syntax highlighting, edit the .gitattribute file +accordingly: +**Example:** + + ``` +neovim/** gitlab-language=vim +spacemacs/** gitlab-language=elisp + ``` + From 272a56ccb96c944b6e8d2a98e11410c5fa1c9b4b Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:26:56 +0200 Subject: [PATCH 07/14] fix readme --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6d3da0a..6971136 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,19 @@ Unitoo standardized dotfiles. ## Directory Logic -The directory tree logic is the following: program_name/program_name.conf and -eventually an associated Markdown file program_name/program_name.md \ -OR program_name/path/to/conf/program_name.conf - && program_name/path/to/conf/program_name.conf \ -**Examples:** neovim/neovim.conf, nginx/etc/nginx/nginx.conf +The directory tree logic is the following: `program_name/program_name.conf` and +eventually an associated Markdown file `program_name/program_name.md` \ +OR `program_name/path/to/conf/program_name.conf` + && `program_name/path/to/conf/program_name.conf` \ +**Examples:** `neovim/neovim.conf, nginx/etc/nginx/nginx.conf` ## Syntax highlighting -To let Gitlab display the proper syntax highlighting, edit the .gitattribute file -accordingly: +To let Gitlab display the proper syntax highlighting, +edit the .gitattribute file accordingly: \ **Example:** - ``` +```txt neovim/** gitlab-language=vim spacemacs/** gitlab-language=elisp - ``` - +``` From c38a4660ef675fcb81d001b8a0fa5638ce18632f Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:29:35 +0200 Subject: [PATCH 08/14] modify logic readme --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6971136..9ca77d0 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,14 @@ Unitoo standardized dotfiles. ## Directory Logic -The directory tree logic is the following: `program_name/program_name.conf` and -eventually an associated Markdown file `program_name/program_name.md` \ -OR `program_name/path/to/conf/program_name.conf` - && `program_name/path/to/conf/program_name.conf` \ +The directory tree logic is the following: `program_name/program_name.conf` \ +Each conf file can have + an associated Markdown file named `program_name/program_name.md` \ + +You can also put the conf inside the actual path + of the configuration file following this logic: \ +`program_name/path/to/conf/program_name.conf, + program_name/path/to/conf/program_name.md` \ **Examples:** `neovim/neovim.conf, nginx/etc/nginx/nginx.conf` ## Syntax highlighting From 8513a9b3d278e5577ea4c85888f3cbf32253caae Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:32:25 +0200 Subject: [PATCH 09/14] fix format --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9ca77d0..2c20104 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,13 @@ Each conf file can have You can also put the conf inside the actual path of the configuration file following this logic: \ `program_name/path/to/conf/program_name.conf, - program_name/path/to/conf/program_name.md` \ + program_name/path/to/conf/program_name.md` **Examples:** `neovim/neovim.conf, nginx/etc/nginx/nginx.conf` ## Syntax highlighting -To let Gitlab display the proper syntax highlighting, +In order to display the proper syntax highlighting on Gitlab, edit the .gitattribute file accordingly: \ -**Example:** ```txt neovim/** gitlab-language=vim From 882970ebb3951d2a6ec1a702a598990d831abcc1 Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 16:35:32 +0200 Subject: [PATCH 10/14] 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 + From 91c1e1fd79bb585fd803ffd7a78246c5995556a5 Mon Sep 17 00:00:00 2001 From: yamabiiko Date: Sat, 10 Apr 2021 15:41:44 +0000 Subject: [PATCH 11/14] Update neovim.md --- neovim/neovim.md | 121 +++++++++++++++++++++++++++++------------------ 1 file changed, 75 insertions(+), 46 deletions(-) diff --git a/neovim/neovim.md b/neovim/neovim.md index 55c3ecc..c1c83a1 100644 --- a/neovim/neovim.md +++ b/neovim/neovim.md @@ -1,49 +1,39 @@ -set nocompatible " Required to read a vim (not vi) config correctly -set completeopt=preview " Completation mode: preview +# Neovim config (general/development) -" 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 +## Global settings +```vim +set nocompatible +set completeopt=preview 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 +``` +These standard vim settings will make the tab key insert 4 spaces instead of using a tab character, and +use preview mode instead of auto-completing when using completion plugins. +```vim 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 +``` +We set the encondig to UTF-8 and show the number line. Setting hidden allows you to quit a buffer without saving it. \ +We don't need showmode since we will be using vim-airline for status. +```vim set nobackup set nowritebackup set noswapfile +``` +Backups, swapfiles and others are disabled. If your system is unstable, you might want to delete those lines, however it can cause problems with servers and cause messy folders. -" 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) +## Custom settings +```vim +autocmd Filetype ruby setlocal ts=2 sw=2 +autocmd Filetype slim setlocal ts=2 sw=2 +filetype plugin indent on +``` +Using tabspaces of 2 on ruby files. (Maybe should use some plugin to manage this, WIP) +```vim +funcion! WinMove(key) let t:curwin = winnr() exec "wincmd ".a:key if (t:curwin == winnr()) @@ -60,24 +50,63 @@ nnoremap :call WinMove('h') nnoremap :call WinMove('j') nnoremap :call WinMove('k') nnoremap :call WinMove('l') +``` +This function and remap lets us use Ctrl + hjkl keys to move windows in neovim +### Key bindings +``` +noremap :bd +map :NERDTreeToggle +map ; :Files +map ' :Rg +nmap ln :noh +``` - -" Using Plug for plugins +- `CTRL+Q` -> Close buffer +- `CTRL+N` -> Open NERDTree +- `\ln` -> Disable highlighting +- `'` -> Search by matching inside files (using fzf + ripgrep) +- `;` -> Search by matching name of files (using fzf + fd) +## Plugin settings +```vim 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 'preservim/nerdtree' +Plug 'neoclide/coc.nvim', { 'branch': 'release' } +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' -Plug 'vim-airline/vim-airline' " Status/tabline for vim +Plug 'vim-airline/vim-airline' 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() +``` +We use vim-plug for plugin management. More information on how to set it up on its [GitHub repo](https://github.com/junegunn/vim-plug) +#### Plugin list: - -filetype plugin indent on -syntax enable - +- [NERDTree](https://github.com/preservim/nerdtree) for browsing directories as trees +- [ConquerOfCompletion](https://github.com/neoclide/coc.nvim) as a completion engine (compatible with VSCode ones) +- [fzf](https://github.com/junegunn/fzf) as a fuzzy file finder +- [vim-airline](https://github.com/vim-airline/vim-airline) as a status line +- [vim-gitgutter](https://github.com/airblade/vim-gitgutter) minimalist git plugin +- [vim-sandwich](https://github.com/machakann/vim-sandwich) and [auto-pairs](https://github.com/jiangmiao/auto-pairs) for brackets management +### Vim-airline settings +```vim +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 +``` +Enable powerline fonts +### Fzf settings/tips +In order to use fd (fast rust alternative to find) with Fzf, install `fd` and add this to your `.bashrc`: +``` +export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git --exclude .vim' +``` +To use ripgrep, simply install it and use `:Rg` (or the shortcut `'`) +### CoC (ConquerOfCompletion) settings/tips +In order to install a particular langauge completion, use `:CocInstall` \ +Here is a small list: +- `coc-go` Golang completion +- `coc-rls` Rust completion +- `coc-pyright` Python completion and static analyzer +- `coc-sh` Bash completion From e209c146503c7257cdb656d0e1ecf14fff13065a Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 17:42:19 +0200 Subject: [PATCH 12/14] update --- README.md | 4 +-- neovim/neovim.md | 83 ------------------------------------------------ 2 files changed, 2 insertions(+), 85 deletions(-) delete mode 100644 neovim/neovim.md diff --git a/README.md b/README.md index 18d1d9e..72f0359 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Unitoo standardized dotfiles. The directory tree logic is the following: `program_name/program_name.conf` \ Each conf file can have - an associated Markdown file named `program_name/program_name.md` \ + an associated Markdown file named `program_name/program_name.md` You can also put the conf inside the actual path of the configuration file following this logic: \ @@ -17,7 +17,7 @@ You can also put the conf inside the actual path ## Syntax highlighting In order to display the proper syntax highlighting on Gitlab, -edit the .gitattributes file accordingly: \ +edit the .gitattributes file accordingly: ```txt neovim/*.conf gitlab-language=vim diff --git a/neovim/neovim.md b/neovim/neovim.md deleted file mode 100644 index 55c3ecc..0000000 --- a/neovim/neovim.md +++ /dev/null @@ -1,83 +0,0 @@ -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 - From 19c2bfcdc562ecfbd4dd776f817bc4b81538af96 Mon Sep 17 00:00:00 2001 From: yamabiiko Date: Sat, 10 Apr 2021 15:46:50 +0000 Subject: [PATCH 13/14] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 72f0359..f899c6c 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,12 @@ Each conf file can have an associated Markdown file named `program_name/program_name.md` You can also put the conf inside the actual path - of the configuration file following this logic: \ -`program_name/path/to/conf/program_name.conf, - program_name/path/to/conf/program_name.md` -**Examples:** `neovim/neovim.conf, nginx/etc/nginx/nginx.conf` + of the configuration file following this logic: `program_name/path/to/conf/program_name.conf` \ +\ +**Examples:** +- `neovim/neovim.conf` +- `nginx/etc/nginx/nginx.conf` +- `nginx/etc/nginx/nginx.md` ## Syntax highlighting From f64f2a0196c1bc2bada0f5cf095a9d56403fd5cf Mon Sep 17 00:00:00 2001 From: Lorenzo Tucci Date: Sat, 10 Apr 2021 17:56:54 +0200 Subject: [PATCH 14/14] uncomment conf --- neovim/neovim.conf | 46 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/neovim/neovim.conf b/neovim/neovim.conf index 55c3ecc..c71b95e 100644 --- a/neovim/neovim.conf +++ b/neovim/neovim.conf @@ -1,48 +1,32 @@ -set nocompatible " Required to read a vim (not vi) config correctly -set completeopt=preview " Completation mode: preview +" Global settings +set nocompatible +set completeopt=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 + +" Custom settings and bindings +autocmd Filetype ruby setlocal ts=2 sw=2 +autocmd Filetype slim setlocal ts=2 sw=2 +filetype plugin indent on + 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 @@ -62,7 +46,7 @@ nnoremap :call WinMove('k') nnoremap :call WinMove('l') -" Using Plug for plugins +" Plugins call plug#begin('~/.vim/plugged') Plug 'preservim/nerdtree' " NerdTree for browsing directories @@ -77,7 +61,7 @@ Plug 'airblade/vim-gitgutter' " Git plugin call plug#end() - -filetype plugin indent on -syntax enable - +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