Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "::::::::::::::::::::::: PLUGIN MANAGER :::::::::::::::::::::::"
- " <<< Download and install Vim-Plug if it's not already installed >>>"
- if empty(glob('$HOME/' . (has('win32') ? 'vimfiles' : '.vim') . '/autoload/plug.vim'))
- " Download Vim-Plug from GitHub
- execute '!curl -fLo ' . (has('win32') ? '\%USERPROFILE\%/vimfiles' : '$HOME/.vim') .
- \ '/autoload/plug.vim --create-dirs ' .
- \ 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
- " Install plugins and update .vimrc
- autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
- endif
- " >>> End Vim-Plug download and install <<<
- " ----------------------------------------------------------------"
- "::::::::::::::::::::: START USING VIM-PLUG :::::::::::::::::::::"
- silent! call plug#begin('~/.vim/plugged')
- " ------------------- Basic Modules ---------------------"
- Plug 'frazrepo/vim-rainbow' " Rainbow parentheses
- Plug 'itchyny/lightline.vim' " Lightline UI
- Plug 'mengelbrecht/lightline-bufferline' " Show buffer list in Lightline UI
- Plug 'machakann/vim-highlightedyank' " Highlight yanked text
- " ------------------ Productivity Plugins ----------------"
- Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " FZF Finder
- Plug 'junegunn/vim-easy-align' " Align text with ease
- Plug 'airblade/vim-gitgutter' " Show Git diff in the gutter
- Plug 'tpope/vim-fugitive' " Git wrapper for Vim
- Plug 'lervag/vimtex' " LaTeX environment for Vim
- Plug 'tpope/vim-surround' " Change {([ in one move
- Plug 'junegunn/goyo.vim' " Distraction-free writing
- Plug 'mbbill/undotree' " Tree-based undo history
- Plug 'editorconfig/editorconfig-vim' " EditorConfig support for Vim
- " ----------------- Syntax Highlighting and Text Objects ------------------"
- Plug 'Yggdroot/indentLine' " Display indent guides
- Plug 'kovetskiy/sxhkd-vim' " Syntax highlighting for sxhkd
- Plug 'ap/vim-css-color' " CSS color preview in Vim
- " Plug 'dracula/vim', { 'as': 'dracula' } " Dracula color scheme for Vim
- " ------------------- Autocompletion -------------------"
- Plug 'Shougo/deoplete.nvim' " Asynchronous autocompletion
- Plug 'roxma/nvim-yarp' " Communication between Vim and its host
- Plug 'roxma/vim-hug-neovim-rpc' " Remote procedure calls for Neovim
- " ------------------- End Vim-Plug -------------------"
- Plug 'dstein64/vim-startuptime'
- call plug#end()
- "::::::::::::::::::: END USING VIM-PLUG ::::::::::::::::::::::"
- "--------------------------------------------------------------------"
- "::::::::::::::::::::: INSTALLED MODULE CONFIGURATIONS :::::::::::::::::::::"
- let g:rainbow_active = 1 " Enable Rainbow parentheses
- " let g:EditorConfig_exclude_patterns = ['fugitive://.*'] "exclude certain files from EditorConfig
- set laststatus=2 " Enable status bar for Lightline UI
- set conceallevel=0 " Conceal markdown style starting at level #1
- "::::::::::::::::::::: END INSTALLED MODULE CONFIGURATIONS :::::::::::::::::::::"
- " Put your non-Plugin stuff after this line
- "-------------------------------------------------------------------
- " set redrawtime=10000 " Increase redraw time to try to maximize large file syntax color
- filetype plugin on " Enable filetype detection, plugin loading, and indenting
- " To ignore changes in indenting for plugins, use:
- " filetype plugin on
- "::::::::::::::::::: COLOR SCHEME OPTIONS ::::::::::::::::::::::"
- " Settings for ST Terminal
- " ----------------------------------------
- " Set Vim-specific sequences for RGB colors
- let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
- let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
- " Settings for alacritty terminal
- " See problem here: https://vi.stackexchange.com/questions/32997/mouse-not-working-inside-alacritty
- if $TERM == 'alacritty'
- set ttymouse=sgr
- endif
- " Set terminal kitty
- set term=kitty
- "
- " Load the colorscheme
- " __________________________________
- " colorscheme dracula " tema dracula <- Commenting out previous colorscheme
- colorscheme rose-pine-dark " Set new colorscheme
- set termguicolors " Enable true colors in terminal
- set t_Co=256 " Set number of colors
- set background=dark " activate dark background
- if has("syntax") " Enable syntax highlighting
- syntax enable
- endif
- " Wrap text & Colors
- " ---------------------------------
- set wrap
- set lazyredraw
- " set textwidth=72 " Setting Hard Wrap text to 72 characters
- set formatprg=par " setting external program for formating
- " (install par application if necessarely)
- set nostartofline " keep cursor in the same column when moving between lines
- "::::::::::::::::::: END COLOR SCHEME OPTIONS ::::::::::::::::::::::"
- " -----Vim jump to the last position when reopening a file
- if has("autocmd")
- au BufReadPost * if line("'\"") > 1 && line("'\"")
- \ <= line("$") | exe "normal! g'\"" | endif
- endif
- set noshowmode " don't show redundant info in lightline
- " like INSERT, VISUAL etc.
- "::::::::::::::::::: FORMATING DOCUMENT ::::::::::::::::::::::"
- set number " without it will get number 0 on current line
- set relativenumber " show relative line number
- " Indentation across VIM
- " ---------------------------------------------------
- set smartindent " self explanatory
- set tabstop=2 " The width of a TAB is set to 2.
- " Still it is a \t. It is just that
- " Vim will interpret it to be having
- " a width of 2.
- set smarttab
- set shiftwidth=2 " Indents will have a width of 2
- set softtabstop=2 " Sets number of columns for a TAB in INSERT mode
- set expandtab " Expand TABs to spaces
- set fileencodings=utf-8
- set encoding=utf-8
- "::::::::::::::::::: END FORMATING DOCUMENT ::::::::::::::::::::::"
- " ------------- aditional settings -----------------
- " Show partial command you type in the last line of the screen.
- set showcmd
- set clipboard=unnamedplus " Copy/paste between vim and other programs.
- " augroup filetypedetect
- " autocmd! BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md set filetype=markdown
- " augroup END
- " Instead of failing a command because of unsaved changes, instead raise a
- " dialogue asking if you wish to save changed files.
- set confirm
- " mapare salvare doc
- map <C-s> :w<cr>
- " ------ don't open some files ------- "
- " There are certain files that we would never want to edit with Vim.
- " Wildmenu will ignore files with these extensions.
- set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
- " Removes pipes | that act as seperators on splits
- " set fillchars+=vert:\
- " setting a VERY broad path to find files within vim
- " eg. :find *nameOfFile
- "
- set path+=** " Searches current directory recursively.
- " setting vim nocompatible with vi
- set nocompatible
- " ---- setting title for Vim ---------- "
- set title
- set omnifunc=syntaxcomplete#Complete " complete words using CTRL+N
- " autocomplete with TAB instead CTRL+N
- inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
- set nohlsearch " no highlight search
- " Show pairs for {} [] ()
- set showmatch
- " settings for mouse
- set mouse=a " Activate the mouse
- set mouse=nicr
- " Set time for Vim to run faster on key pressed
- " set timeout
- " set timeoutlen=2000
- " set ttimeoutlen=100
- silent! set updatetime=300 timeout timeoutlen=2000 ttimeout ttimeoutlen=100 ttyfast
- " Searching across Vim
- set incsearch " Enables incremental search; jumps across file when searching
- set hlsearch " Enables highlighting of search results
- set ignorecase " Tells Vim to ignore case when searching
- set smartcase " Makes Vim behave differently depending on whether the search
- " query contains uppercase letters or not
- set linebreak " Wraps lines at word boundaries when displaying text
- " Set menu wider when pressing tab
- set wildmenu
- set wildmode=longest:list,full
- " Enables Vim to undo a file after was closed
- set undofile
- " set cursorline " enable cursor line horiz
- " <<< Mapping Vim ----------------------------------------
- " Set options for split windows
- " Prevent automatic adjustment of split window sizes
- set noequalalways
- " Set options for opening new splits
- " Open new splits below and to the right by default
- set splitbelow splitright
- " >>> Mapping Vim
- " Set a custom font you have installed on your computer.
- " Syntax: set guifont=<font_name>\ <font_weight>\ <size>
- " The following are taken from rwxrob
- " https://github.com/rwxrob/dot/blob/main/vim/.vimrc
- set icon
- " ------- prevents truncated yanks, deletes, etc --------- "
- set viminfo='20,<1000,s1000
- " -------- spell check --------- "
- set spelllang=ro,literatura
- " Highlight white spaces in all the buffers
- " If white spaces are detected, make them red
- highlight ws ctermbg=red guibg=red
- match ws /\s\+$/
- autocmd BufWinEnter * match ws /\s\+$/
- iab SS §
- iab PP ¶
- iab dpdv din punct de vedere
- "Set shortmess=aoOtTI to abbreviate and truncate messages,
- "reducing interruptions and distractions.
- "a: Abbreviates "ATTENTION" messages, e.g. when Vim waits for input.
- "t: Truncates file messages to show only the filename.
- "T: Truncates "Press ENTER" messages in the command-line.
- set shortmess+=F
- " Disable automatic indentation to make Vim faster on large files
- set noautoindent
- " Set the 'scrolloff' option to 10
- " This option determines the number of lines displayed above and below the cursor when scrolling
- set scrolloff=10
- " Autosave buffer when changes are made
- " autocmd TextChanged,TextChangedI <buffer> silent write
- " Sourcing mappings file.
- source ~/.vim/mappings.vim
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement