From f0ebf0054de67c854f61c6d5e7a84aad7a83ccbf Mon Sep 17 00:00:00 2001 From: Francesco Date: Wed, 6 Mar 2024 22:45:10 +0100 Subject: [PATCH] a new fresh vimscript config --- README.md | 17 +++++++++++++-- init.vim | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 init.vim diff --git a/README.md b/README.md index 10ccbf6..994fbd9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,21 @@ # dotfiles - My attempt to make my personal dotfiles (I'm doing this to learn more about Linux and the Vim's world!) ## My setup - Neovim -Install your preferred LSP (`coc-rust-analyzer`, `coc-pyright`, and so on...) +### Startup +First of all install jedi by typing: +```bash +pip install jedi-language-server +``` + +After cloned the repo, move the `init.vim` in the neovim config, start neovim and type: `:PlugInstall`. This should do all the stuff needed. + +### Other +Install your preferred LSP (`coc-rust-analyzer`, `coc-python`, and so on...) + +## Keybindings +- CTRL + ww -> change window's focus +- CTRL + y -> accept autocomplete suggestion +- m (with nerdtree focused) -> opens the nerdtree's menu diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..2266a7e --- /dev/null +++ b/init.vim @@ -0,0 +1,64 @@ +let mapleader = "\" + +set encoding=utf-8 +set termguicolors +set noswapfile +set undofile +set clipboard=unnamedplus +set mouse=a + +set autoindent +set expandtab +set shiftwidth=2 +set softtabstop=2 + +set number +set relativenumber +set cursorline + +set showmatch +set matchpairs+=<:> +set matchtime=5 + +set hlsearch +set incsearch +set ignorecase +set smartcase + +call plug#begin('~/.config/nvim/plugged') +Plug 'tpope/vim-fugitive' " Git integration +Plug 'tpope/vim-commentary' " Commenting +Plug 'tpope/vim-surround' " Manipulating surroundings +Plug 'preservim/nerdtree' " File explorer +Plug 'itchyny/lightline.vim' " Statusline + +Plug 'neoclide/coc.nvim', {'branch': 'release'} " Language server protocol support +Plug 'SirVer/ultisnips' " Snippet engine +Plug 'honza/vim-snippets' " Snippets library + +Plug 'davidhalter/jedi-vim' " Python autocompletion +Plug 'vim-scripts/c.vim' " C syntax and indentation +Plug 'rust-lang/rust.vim' " Rust syntax and indentation + +Plug 'folke/tokyonight.nvim' +call plug#end() + +colorscheme tokyonight-night + +let g:coc_global_extensions = [ + \ 'coc-snippets', + \ 'coc-jedi', + \ 'coc-clangd', + \ 'coc-rls', + \] + +"let g:jedi#completions_enabled = 1 + +if has('nvim') + set updatetime=300 + set winwidth=84 + set backupdir=~/.config/nvim/backup// + set directory=~/.config/nvim/swap// +endif + +autocmd VimEnter * NERDTree \ No newline at end of file