Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " leader key
- let mapleader = " "
- " Configure expanding of tabs for various file types
- au BufRead, BufNewFile *.py set expandtab
- au BufRead, BufNewFile *.c set noexpandtab
- au BufRead, BufNewFile *.h set noexpandtab
- au BufRead, BufNewFile Makefile* set noexpandtab
- set listchars=tab:Γû╕\ " ΓöÉ
- set listchars+=trail:┬╖ " Γöé Use custom symbols to
- set listchars+=eol:↴ " │ represent invisible characters
- set listchars+=nbsp:_ " Γöÿ
- set magic " Enable extended regexp
- set mousehide " Hide mouse pointer while typing
- set noerrorbells " Disable error bells
- set nojoinspaces " When using the join command,
- " only insert a single space
- " after a `.`, `?`, or `!`
- set tabstop=4
- set nocompatible
- set shiftwidth=4
- set expandtab
- set autoindent
- set smartindent
- set ruler
- set showcmd
- set incsearch
- set number
- set relativenumber
- set cino+=L0
- set paste
- set linebreak
- set title
- set mouse=v
- set history=50
- set matchtime=2
- set matchpairs+=<:>
- set cb=unnamed
- set showmatch
- set softtabstop=4
- set textwidth=120
- set smarttab
- set nostartofline
- set report=0
- set numberwidth=5
- set scrolloff=5
- "set shortmess=aAItW
- set showmode
- set synmaxcol=2500
- set hlsearch
- set lazyredraw
- " Setting up the undofile, ttyfast, virtualedit
- set undofile
- set ttyfast
- set virtualedit=all
- set visualbell
- set noerrorbells
- set t_vb=
- set wildmenu
- " Smart wrapping
- set wrap
- set formatoptions=qrn1
- " Smart Search
- set ignorecase
- set smartcase
- " Search as characters are entered
- set incsearch
- " C/C++ Indent
- set cindent
- " Enabling the backspace key
- set backspace=indent,eol,start
- " Setting up the font, encoding and font size
- let &guifont = 'Hack Nerd Font Mono:h10'
- set encoding=UTF-8
- " Enabling the pastetoggle
- set pastetoggle=<F11>
- " Setting nerdtree to ignore unnecessary files
- let NERDTreeIgnore = ['\.DAT$', '\.LOG1$', '\.LOG1$']
- syntax on
- filetype indent on
- filetype off
- setlocal indentkeys-=:
- set t_Co=256
- set foldmethod=indent
- set foldlevel=99
- set backup
- "startup full screen
- au GUIEnter * sim ~x
- " very useful for yaml files
- autocmd Filetype yaml set cursorcolumn
- autocmd Filetype yml set cursorcolumn
- " Split settings
- set splitbelow splitright
- " New python file Buff
- au BufNewFile, BufRead *.py
- \ set tabstop=4
- \ set softtabstop=4
- \ set shiftwidth=4
- \ set textwidth=79
- \ set expandtab
- \ set autoindent
- \ set fileformat=unix
- autocmd Filetype python set cursorcolumn
- "keybindings for { completion, "jk" for escape, ctrl-a to select all
- inoremap {<CR> {<CR>}<Esc>O
- inoremap {} {}
- imap jk <Esc>
- map <C-a> <esc>ggVG<CR>
- set belloff=all
- " Keybindings for python file execution
- autocmd FileType python nnoremap <buffer> <F9> :update<bar>!python %<CR>
- " Hiding the toolbar and menubar
- set guioptions -=m
- set guioptions -=T
- set guioptions -=r
- " Ale Linting setup for python
- let g:ale_linters = {'python': ['flake8']}
- "Plugin setup
- call plug#begin()
- Plug 'junegunn/vim-plug'
- Plug 'lervag/vimtex'
- Plug 'octol/vim-cpp-enhanced-highlight'
- Plug 'tpope/vim-dispatch'
- Plug 'vim-airline/vim-airline'
- Plug 'neoclide/coc.nvim'
- Plug 'frazrepo/vim-rainbow'
- Plug 'jiangmiao/auto-pairs'
- Plug 'pangloss/vim-javascript'
- Plug 'leafgarland/typescript-vim'
- Plug 'peitalin/vim-jsx-typescript'
- Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
- Plug 'jparise/vim-graphql'
- Plug 'dense-analysis/ale'
- Plug 'krischik/Rainbow-Parenthesis-Bundle'
- Plug 'rust-lang/rust.vim'
- Plug 'nvie/vim-flake8'
- Plug 'ryanoasis/vim-devicons'
- Plug 'drewtempelmeyer/palenight.vim'
- Plug 'vim-airline/vim-airline-themes'
- Plug 'junegunn/limelight.vim'
- Plug 'junegunn/goyo.vim'
- Plug 'searleser97/cpbooster.vim'
- Plug 'vim-scripts/errormarker.vim'
- Plug 'gruvbox-community/gruvbox'
- Plug 'preservim/nerdtree', {'on': 'NERDTreeToggle'}
- Plug 'Xuyuanp/nerdtree-git-plugin'
- Plug 'ryanoasis/vim-devicons'
- Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
- Plug 'PhilRunninger/nerdtree-buffer-ops'
- Plug 'mattn/emmet-vim'
- Plug 'ap/vim-css-color'
- Plug 'stephpy/vim-php-cs-fixer'
- Plug 'arnaud-lb/vim-php-namespace'
- Plug 'craigemery/vim-autotag'
- Plug 'othree/xml.vim'
- Plug 'sainnhe/everforest'
- Plug 'sainnhe/gruvbox-material'
- Plug 'nvim-treesitter/nvim-treesitter'
- Plug 'xolox/vim-lua-ftplugin'
- Plug 'xolox/vim-misc'
- Plug 'pineapplegiant/spaceduck'
- Plug 'sjl/badwolf'
- Plug '4513ECHO/vim-colors-hatsunemiku'
- Plug 'Rigellute/shades-of-purple.vim'
- Plug 'leafgarland/typescript-vim'
- Plug 'MaxMEllon/vim-jsx-pretty'
- call plug#end()
- filetype plugin indent on
- let g:vimtex_view_general_viewer = 'SumatraPDF'
- let g:vimtex_view_general_options = '-reuse-instance @pdf'
- let g:vimtex_view_general_options_latexmk = '-reuse-instance'
- let g:tex_flavor = 'latex'
- let g:vimtex_motion_matchparen = 0
- let g:vimtex_fold_manual = 1
- let g:vimtex_matchparen_enabled = 0
- " Coc Extensions
- "let g:coc_global_extensions = ["coc-tsserver"]
- " Lua setup for vim
- let g:lua_check_syntax=1
- let g:lua_complete_omni=1
- let g:lua_compiler_name='C:\Program Files\lua\bin\luac.exe'
- " copy, cut and paste
- vmap <C-c> "+y
- vmap <C-x> "+c
- vmap <C-v> c<ESC>"+p
- imap <C-v> <ESC> "+pa
- " Clipboard configuration
- let s:clip = 'C:\Windows\System32\clip.exe'
- if executable(s:clip)
- augroup WSLYank
- autocmd!
- autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
- augroup END
- endif
- au BufNewFile, BufRead *.tex
- \ set nocursorline
- \ set nornu
- \ set number
- " disable autoindent when pasting text
- " source: https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode
- let &t_SI .= "\<Esc>[?2004h"
- let &t_EI .= "\<Esc>[?2004l"
- function! XTermPasteBegin()
- set pastetoggle=<Esc>[201~
- set paste
- return ""
- endfunction
- inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
- "Append template to new C++ files
- autocmd BufNewFile *.cpp 0r C:/Users/alent/Documents/vimws/Template.cpp
- "Compile and run
- "Note that the next uncommented line requires the build.sh script!
- "Replace it with the commented line below if you don't have it
- "set makeprg=g++\ -static\ -DDEBUG\ -lm\ -s\ -x\ c++\ -Wall\ -Wextra\ -O2\ -std=c++17\ -o\ %:r\ %
- "set makeprg=build.sh\ %:r
- "autocmd filetype cpp nnoremap <F9> :w <bar> Make <CR>
- "autocmd filetype cpp nnoremap <F9> :w <bar> !build.sh %:r <CR>
- "autocmd filetype cpp nnoremap <F10> :vertical terminal ++shell ++cols=40 %:r<CR>
- "autocmd filetype cpp nnoremap <F11> :!%:r<CR>
- "autocmd filetype java nnoremap <F9> :w <bar> !javac %<CR>
- "autocmd filetype java nnoremap <F10> :vertical terminal ++shell ++cols=40 java %:r<CR>
- "autocmd filetype java nnoremap <F11> :!java %:r<CR>
- autocmd filetype cpp nnoremap <F9> :w <bar> !g++ -std=c++17 % -o %:r -Wl,--stack,268435456<CR>
- autocmd filetype cpp nnoremap <F10> :!%:r<CR>
- autocmd filetype cpp nnoremap <C-C> :s/^\(\s*\)/\1\/\/<CR> :s/^\(\s*\)\/\/\/\//\1<CR> $
- " Javascript Highlighting
- autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart
- autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear
- "LaTeX settings
- autocmd FileType tex :NoMatchParen
- autocmd FileType tex :set tw=110
- " Vim Theme Customization
- "let g:molokai_original = 1
- "let g:rehash256 = 1
- "colorscheme molokai
- set termguicolors
- colorscheme gruvbox
- set background=dark
- let g:gruvbox_guisp_fallback = "bg"
- let g:gruvbox_italic = 1
- " Spelling
- setlocal spell spelllang=en_us
- setlocal spell!
- " Airline theme
- let g:airline_theme='gruvbox'
- " Split navigations
- nnoremap <C-J> <C-W><C-J>
- nnoremap <C-K> <C-W><C-K>
- nnoremap <C-L> <C-W><C-L>
- nnoremap <C-H> <C-W><C-H>
- " Tabnew settings
- nnoremap <C-Left> :tabprevious<CR>
- nnoremap <C-Right> :tabnext<CR>
- nnoremap <C-j> :tabprevious<CR>
- nnoremap <C-k> :tabnext<CR>
- " Vim Rainbow
- let g:rainbow_active = 1
- " NerdTree
- inoremap <c-b> <Esc>:NERDTreeToggle<cr>
- nnoremap <c-b> <Esc>:NERDTreeToggle<cr>
- " Always show sign column (the column at the left of the numbers)
- set signcolumn=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement