# neovim sudo pacman -Sy neovim # plugin manager sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' # support python plugins in neovim pip3 install pynvim # reread .bashrc . ~/.bashrc # create config file mkdir -p ~/.config/nvim # add config echo "set nocompatible " disable compatibility to old-time vi set showmatch " show matching set ignorecase " case insensitive set mouse=v " middle-click paste with set hlsearch " highlight search set incsearch " incremental search set tabstop=4 " number of columns occupied by a tab set softtabstop=4 " see multiple spaces as tabstops so does the right thing set expandtab " converts tabs to white space set shiftwidth=4 " width for autoindents set autoindent " indent a new line the same amount as the line just typed set number " add line numbers set wildmode=longest,list " get bash-like tab completions set cc=80 " set an 80 column border for good coding style filetype plugin indent on "allow auto-indenting depending on file type syntax on " syntax highlighting set mouse=a " enable mouse click set clipboard=unnamedplus " using system clipboard filetype plugin on set cursorline " highlight current cursorline set ttyfast " Speed up scrolling in Vim call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged') Plug 'dracula/vim' Plug 'ryanoasis/vim-devicons' Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' Plug 'scrooloose/nerdtree' Plug 'preservim/nerdcommenter' Plug 'mhinz/vim-startify' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons Plug 'nvim-tree/nvim-tree.lua' call plug#end() " color schemes if (has("termguicolors")) set termguicolors endif syntax enable " colorscheme evening colorscheme dracula " open new split panes to right and below set splitright set splitbelow " move line or visually selected block - alt+j/k inoremap :m .+1==gi inoremap :m .-2==gi vnoremap :m '>+1gv=gv vnoremap :m '<-2gv=gv" move split panes to left/bottom/top/right nnoremap H nnoremap J nnoremap K nnoremap L" move between panes to left/bottom/top/right nnoremap h nnoremap j nnoremap k nnoremap l " Press i to enter insert mode, and ii to exit insert mode. :inoremap ii :inoremap jk :inoremap kj :vnoremap jk :vnoremap kj " open file in a text by placing text and gf nnoremap gf :vert winc f" copies filepath to clipboard by pressing yf :nnoremap yf :let @+=expand('%:p') " copies pwd to clipboard: command yd :nnoremap yd :let @+=expand('%:p:h')" Vim jump to the last position when reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") \| exe "normal! g'\"" | endif endif lua <> ~/.config/nvim/init.vim # install plugins in neovim :PlugInstall # neovim tree plugin start :NvimTreeOpen # neovim tree plugin end :NvimTreeClose