Advertisement
Guest User

Untitled

a guest
Mar 15th, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 9.67 KB | Source Code | 0 0
  1. "::::::::::::::::::::::: PLUGIN MANAGER :::::::::::::::::::::::"
  2.  
  3. " <<< Download and install Vim-Plug if it's not already installed >>>"
  4.  
  5. if empty(glob('$HOME/' . (has('win32') ? 'vimfiles' : '.vim') . '/autoload/plug.vim'))
  6.  
  7.   " Download Vim-Plug from GitHub
  8.   execute '!curl -fLo ' . (has('win32') ? '\%USERPROFILE\%/vimfiles' : '$HOME/.vim') .
  9.           \ '/autoload/plug.vim --create-dirs ' .
  10.           \ 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  11.  
  12.   " Install plugins and update .vimrc
  13.   autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  14.  
  15. endif
  16.  
  17. " >>> End Vim-Plug download and install <<<
  18.  
  19. " ----------------------------------------------------------------"
  20.  
  21. "::::::::::::::::::::: START USING VIM-PLUG :::::::::::::::::::::"
  22.  
  23. silent! call plug#begin('~/.vim/plugged')
  24.  
  25. " ------------------- Basic Modules ---------------------"
  26.  
  27. Plug 'frazrepo/vim-rainbow'              " Rainbow parentheses
  28. Plug 'itchyny/lightline.vim'             " Lightline UI
  29. Plug 'mengelbrecht/lightline-bufferline' " Show buffer list in Lightline UI
  30. Plug 'machakann/vim-highlightedyank'     " Highlight yanked text
  31.  
  32. " ------------------ Productivity Plugins ----------------"
  33.  
  34. Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " FZF Finder
  35. Plug 'junegunn/vim-easy-align'          " Align text with ease
  36. Plug 'airblade/vim-gitgutter'           " Show Git diff in the gutter
  37. Plug 'tpope/vim-fugitive'               " Git wrapper for Vim
  38. Plug 'lervag/vimtex'                    " LaTeX environment for Vim
  39. Plug 'tpope/vim-surround'               " Change {([ in one move
  40. Plug 'junegunn/goyo.vim'                " Distraction-free writing
  41. Plug 'mbbill/undotree'                  " Tree-based undo history
  42. Plug 'editorconfig/editorconfig-vim'    " EditorConfig support for Vim
  43.  
  44. " ----------------- Syntax Highlighting and Text Objects ------------------"
  45.  
  46. Plug 'Yggdroot/indentLine' " Display indent guides
  47. Plug 'kovetskiy/sxhkd-vim' " Syntax highlighting for sxhkd
  48. Plug 'ap/vim-css-color' " CSS color preview in Vim
  49. " Plug 'dracula/vim', { 'as': 'dracula' } " Dracula color scheme for Vim
  50.  
  51. " ------------------- Autocompletion -------------------"
  52.  
  53. Plug 'Shougo/deoplete.nvim' " Asynchronous autocompletion
  54. Plug 'roxma/nvim-yarp' " Communication between Vim and its host
  55. Plug 'roxma/vim-hug-neovim-rpc' " Remote procedure calls for Neovim
  56.  
  57. " ------------------- End Vim-Plug -------------------"
  58. Plug 'dstein64/vim-startuptime'
  59.  
  60. call plug#end()
  61.  
  62. "::::::::::::::::::: END USING VIM-PLUG ::::::::::::::::::::::"
  63.  
  64. "--------------------------------------------------------------------"
  65.  
  66. "::::::::::::::::::::: INSTALLED MODULE CONFIGURATIONS :::::::::::::::::::::"
  67.  
  68. let g:rainbow_active = 1 " Enable Rainbow parentheses
  69. " let g:EditorConfig_exclude_patterns = ['fugitive://.*'] "exclude certain files from EditorConfig
  70. set laststatus=2 " Enable status bar for Lightline UI
  71. set conceallevel=0 " Conceal markdown style starting at level #1
  72.  
  73. "::::::::::::::::::::: END INSTALLED MODULE CONFIGURATIONS :::::::::::::::::::::"
  74.  
  75.  
  76. " Put your non-Plugin stuff after this line
  77. "-------------------------------------------------------------------
  78. " set redrawtime=10000 " Increase redraw time to try to maximize large file syntax color
  79.  
  80. filetype plugin on " Enable filetype detection, plugin loading, and indenting
  81. " To ignore changes in indenting for plugins, use:
  82. " filetype plugin on
  83.  
  84. "::::::::::::::::::: COLOR SCHEME OPTIONS ::::::::::::::::::::::"
  85.  
  86. " Settings for ST Terminal
  87. " ----------------------------------------
  88.  
  89. " Set Vim-specific sequences for RGB colors
  90. let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
  91. let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
  92.  
  93.  
  94. " Settings for alacritty terminal
  95. " See problem here: https://vi.stackexchange.com/questions/32997/mouse-not-working-inside-alacritty
  96.  
  97. if $TERM == 'alacritty'
  98.   set ttymouse=sgr
  99. endif
  100.  
  101.  
  102. " Set terminal kitty
  103. set term=kitty
  104. "
  105. " Load the colorscheme
  106. " __________________________________
  107.  
  108. " colorscheme dracula " tema dracula     <- Commenting out previous colorscheme
  109. colorscheme rose-pine-dark                " Set new colorscheme
  110.  
  111. set termguicolors                         " Enable true colors in terminal
  112. set t_Co=256                              " Set number of colors
  113. set background=dark                       " activate dark background
  114.  
  115. if has("syntax")                          " Enable syntax highlighting
  116.     syntax enable
  117. endif
  118.  
  119.  
  120. " Wrap text & Colors
  121. " ---------------------------------
  122. set wrap
  123. set lazyredraw
  124.  
  125. " set textwidth=72   " Setting Hard Wrap text to 72 characters
  126. set formatprg=par   " setting external program for formating
  127.                     " (install par application if necessarely)
  128. set nostartofline   " keep cursor in the same column when moving between lines
  129.  
  130.  
  131. "::::::::::::::::::: END COLOR SCHEME OPTIONS ::::::::::::::::::::::"
  132.  
  133.  
  134. " -----Vim jump to the last position when reopening a file
  135. if has("autocmd")
  136.   au BufReadPost * if line("'\"") > 1 && line("'\"")
  137.         \ <= line("$") | exe "normal! g'\"" | endif
  138. endif
  139.  
  140. set noshowmode  " don't show redundant info in lightline
  141.                 " like INSERT, VISUAL etc.
  142.  
  143.  
  144. "::::::::::::::::::: FORMATING DOCUMENT ::::::::::::::::::::::"
  145.  
  146. set number              " without it will get number 0 on current line
  147. set relativenumber  " show relative line number
  148.  
  149. " Indentation across VIM
  150. " ---------------------------------------------------
  151. set smartindent     " self explanatory
  152. set tabstop=2       " The width of a TAB is set to 2.
  153.                     " Still it is a \t. It is just that
  154.                     " Vim will interpret it to be having
  155.                     " a width of 2.
  156. set smarttab
  157. set shiftwidth=2    " Indents will have a width of 2
  158. set softtabstop=2   " Sets number of columns for a TAB in INSERT mode
  159. set expandtab       " Expand TABs to spaces
  160.  
  161. set fileencodings=utf-8
  162. set encoding=utf-8
  163.  
  164. "::::::::::::::::::: END FORMATING DOCUMENT ::::::::::::::::::::::"
  165.  
  166. " ------------- aditional settings -----------------
  167.  
  168.  
  169. " Show partial command you type in the last line of the screen.
  170. set showcmd
  171. set clipboard=unnamedplus " Copy/paste between vim and other programs.
  172.  
  173. " augroup filetypedetect
  174. "   autocmd! BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md set filetype=markdown
  175. " augroup END
  176.  
  177. " Instead of failing a command because of unsaved changes, instead raise a
  178. " dialogue asking if you wish to save changed files.
  179.  
  180. set confirm
  181.  
  182. " mapare salvare doc
  183. map <C-s> :w<cr>
  184.  
  185. " ------ don't open some files ------- "
  186. " There are certain files that we would never want to edit with Vim.
  187. " Wildmenu will ignore files with these extensions.
  188. set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
  189.  
  190. " Removes pipes | that act as seperators on splits
  191. " set fillchars+=vert:\
  192.  
  193. " setting a VERY broad path to find files within vim
  194. " eg. :find *nameOfFile
  195. "
  196. set path+=**    " Searches current directory recursively.
  197.  
  198. " setting vim nocompatible with vi
  199. set nocompatible
  200.  
  201. " ---- setting title for Vim ---------- "
  202. set title
  203.  
  204. set omnifunc=syntaxcomplete#Complete " complete words using CTRL+N
  205.  
  206. " autocomplete with TAB instead CTRL+N
  207. inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
  208.  
  209. set nohlsearch " no highlight search
  210.  
  211. " Show pairs for {} [] ()
  212. set showmatch
  213.  
  214. " settings for mouse
  215. set mouse=a " Activate the mouse
  216. set mouse=nicr
  217.  
  218. " Set time for Vim to run faster on key pressed
  219. " set timeout
  220. " set timeoutlen=2000
  221. " set ttimeoutlen=100
  222.  
  223. silent! set updatetime=300 timeout timeoutlen=2000 ttimeout ttimeoutlen=100 ttyfast
  224.  
  225.  
  226. " Searching across Vim
  227. set incsearch   " Enables incremental search; jumps across file when searching
  228. set hlsearch    " Enables highlighting of search results
  229. set ignorecase  " Tells Vim to ignore case when searching
  230. set smartcase   " Makes Vim behave differently depending on whether the search
  231.                 " query contains uppercase letters or not
  232. set linebreak   " Wraps lines at word boundaries when displaying text
  233.  
  234. " Set menu wider when pressing tab
  235. set wildmenu
  236. set wildmode=longest:list,full
  237.  
  238. " Enables Vim to undo a file after was closed
  239. set undofile
  240.  
  241. " set cursorline " enable cursor line horiz
  242.  
  243. " <<< Mapping Vim ----------------------------------------
  244.  
  245. " Set options for split windows
  246. " Prevent automatic adjustment of split window sizes
  247. set noequalalways
  248.  
  249. " Set options for opening new splits
  250. " Open new splits below and to the right by default
  251. set splitbelow splitright
  252.  
  253. " >>> Mapping Vim
  254.  
  255. " Set a custom font you have installed on your computer.
  256. " Syntax: set guifont=<font_name>\ <font_weight>\ <size>
  257.  
  258. " The following are taken from rwxrob
  259. " https://github.com/rwxrob/dot/blob/main/vim/.vimrc
  260.  
  261. set icon
  262.  
  263. " ------- prevents truncated yanks, deletes, etc --------- "
  264. set viminfo='20,<1000,s1000
  265.  
  266. " -------- spell check --------- "
  267.  
  268. set spelllang=ro,literatura
  269.  
  270. " Highlight white spaces in all the buffers
  271. " If white spaces are detected, make them red
  272. highlight ws ctermbg=red guibg=red
  273. match ws /\s\+$/
  274. autocmd BufWinEnter * match ws /\s\+$/
  275.  
  276. iab SS §
  277. iab PP ¶
  278. iab dpdv din punct de vedere
  279.  
  280. "Set shortmess=aoOtTI to abbreviate and truncate messages,
  281. "reducing interruptions and distractions.
  282. "a: Abbreviates "ATTENTION" messages, e.g. when Vim waits for input.
  283. "t: Truncates file messages to show only the filename.
  284. "T: Truncates "Press ENTER" messages in the command-line.
  285. set shortmess+=F
  286.  
  287. " Disable automatic indentation to make Vim faster on large files
  288. set noautoindent
  289.  
  290. " Set the 'scrolloff' option to 10
  291. " This option determines the number of lines displayed above and below the cursor when scrolling
  292. set scrolloff=10
  293.  
  294. " Autosave buffer when changes are made
  295. " autocmd TextChanged,TextChangedI <buffer> silent write
  296.  
  297.  
  298. " Sourcing mappings file.
  299. source ~/.vim/mappings.vim
  300.  
  301.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement