Guest User

Untitled

a guest
Jul 31st, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.55 KB | None | 0 0
  1. packloadall
  2.  
  3. set nocompatible
  4. filetype plugin on
  5. syntax on
  6.  
  7. " SET
  8. set background=dark
  9. set termguicolors
  10. set clipboard=unnamedplus
  11. set nu rnu
  12. set wrap linebreak
  13. set number nobackup nowritebackup splitbelow splitright
  14. set mouse=a
  15. set autoindent
  16. set shiftwidth=4
  17. set smarttab
  18. set nohlsearch
  19. set termguicolors
  20. set ttimeoutlen=50
  21. set backspace=indent,eol,start
  22. set incsearch
  23. " set hlsearch
  24. set ignorecase
  25. set smartcase
  26. " set omnifunc
  27. " set rtp+=~/.fzf
  28.  
  29. " set list
  30. set fillchars=vert:\
  31.  
  32. " LET
  33. let g:python3_host_prog = "/usr/bin/python3"
  34. " Set the diagnostic popup to never show
  35. let g:airline_theme='deus'
  36. let g:lsp_signs_enable = v:false
  37. let g:lsp_diagnostics_enabled = v:false
  38. let g:neosnippet#snippets_directory='~/.vim/plugged/vim-snippets/snippets'
  39. let NERDTreeShowHidden=1
  40. let g:vimwiki_list = [{'path': '~/wiki/', 'syntax': 'markdown'}]
  41. " Initialize configuration dictionary
  42. let g:fzf_vim = {}
  43. let g:fzf_vim.preview_window = ['hidden,right,50%,<70(up,40%)', 'ctrl-/']
  44.  
  45. let g:easycomplete_nerd_font = 1
  46. let g:easycomplete_winborder = 10
  47. let g:easycomplete_pum_format = ["kind", "abbr", "menu"]
  48.  
  49. let g:easycomplete_diagnostics_next = "<C-j>"
  50. " let g:easycomplete_diagnostics_previous = "<C-k>"
  51.  
  52.  
  53. let g:UltiSnipsExpandTrigger='<cr>'
  54. let g:UltiSnipsJumpForwardTrigger='<c-b>'
  55. let g:UltiSnipsJumpBackwardTrigger='<c-z>'
  56. let g:UltiSnipsListSnippets='<c-l>'
  57.  
  58.  
  59. " COLORSCHEME
  60. colorscheme gruvbox
  61.  
  62. set t_Co=256
  63. if &term =~ '256color'
  64. set t_ut=
  65. endif
  66.  
  67.  
  68. " INSERT MODE MAPPINGS
  69. inoremap ( ()<Left>
  70. inoremap (( (
  71. inoremap [ []<Left>
  72. inoremap [[ [
  73. inoremap " ""<Left>
  74. inoremap "" "
  75. inoremap { {}<Left>
  76. inoremap {{ {
  77. inoremap ' ''<Left>
  78. inoremap '' '
  79.  
  80.  
  81. function! ToggleTexMapping()
  82. if &filetype != 'tex'
  83. inoremap ' ''<Left>
  84. else
  85. iunmap '
  86. endif
  87. endfunction
  88.  
  89. augroup NonTexFileMappings
  90. autocmd!
  91. autocmd FileType * call ToggleTexMapping()
  92. augroup END
  93.  
  94. if executable('clangd')
  95. " pip install python-lsp-server
  96. au User lsp_setup call lsp#register_server({
  97. \ 'name': 'clangd',
  98. \ 'cmd': {server_info->['clangd']},
  99. \ 'allowlist': ['c'],
  100. \ })
  101. endif
  102.  
  103. function! s:on_lsp_buffer_enabled() abort
  104. setlocal omnifunc=lsp#complete
  105. setlocal signcolumn=yes
  106. if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
  107. nmap <buffer> gd <plug>(lsp-definition)
  108. nmap <buffer> gs <plug>(lsp-document-symbol-search)
  109. nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
  110. nmap <buffer> gr <plug>(lsp-references)
  111. nmap <buffer> gi <plug>(lsp-implementation)
  112. nmap <buffer> gt <plug>(lsp-type-definition)
  113. nmap <buffer> <leader>rn <plug>(lsp-rename)
  114. nmap <buffer> [g <plug>(lsp-previous-diagnostic)
  115. nmap <buffer> ]g <plug>(lsp-next-diagnostic)
  116. nmap <buffer> K <plug>(lsp-hover)
  117. " nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
  118. " nnoremap <buffer> <expr><c-g> lsp#scroll(-4)
  119.  
  120. let g:lsp_format_sync_timeout = 1000
  121. autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
  122.  
  123. " refer to doc to add more commands
  124. endfunction
  125.  
  126. augroup lsp_install
  127. au!
  128. " call s:on_lsp_buffer_enabled only for languages that has the server registered.
  129. autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
  130. augroup END
  131.  
  132. " NORMAL MODE MAPPINGS
  133.  
  134. nnoremap <C-n> :NERDTreeToggle<CR>
  135. map <Leader>t :term ++close<cr>
  136. tmap <Leader>t <c-w>:term ++close<cr>
  137. nnoremap <leader>ff <cmd>FZF<cr>
  138. nnoremap <leader>fg <cmd>Ag<cr>
  139.  
  140.  
  141. " VIM-PLUG
  142. call plug#begin('~/.vim/plugged')
  143. Plug 'junegunn/vim-easy-align'
  144.  
  145.  
  146. Plug 'prabirshrestha/vim-lsp'
  147.  
  148. Plug 'mattn/vim-lsp-settings'
  149.  
  150. Plug 'honza/vim-snippets'
  151.  
  152. Plug 'junegunn/vim-easy-align'
  153.  
  154. Plug 'junegunn/vim-github-dashboard'
  155.  
  156. Plug 'lervag/vimtex'
  157.  
  158. Plug 'ghifarit53/tokyonight-vim'
  159. " SNIPPET
  160.  
  161. Plug 'Shougo/neosnippet.vim'
  162. Plug 'prabirshrestha/async.vim'
  163. Plug 'thomasfaingnaert/vim-lsp-snippets'
  164. Plug 'thomasfaingnaert/vim-lsp-neosnippet'
  165. Plug 'Shougo/neosnippet-snippets'
  166.  
  167. " Plug 'nvim-lua/plenary.nvim'
  168. " Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' }
  169. " or , { 'branch': '0.1.x' }
  170. Plug 'jayli/vim-easycomplete'
  171. Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
  172. Plug 'junegunn/fzf.vim'
  173. Plug 'sirVer/ultisnips'
  174. call plug#end()
  175.  
  176. " VUNDLE
  177.  
  178. set nocompatible " be iMproved, required
  179. filetype off " required
  180.  
  181. " set the runtime path to include Vundle and initialize
  182. set rtp+=~/.vim/bundle/Vundle.vim
  183. call vundle#begin()
  184. " alternatively, pass a path where Vundle should install plugins
  185. "call vundle#begin('~/some/path/here')
  186.  
  187. Plugin 'VundleVim/Vundle.vim'
  188.  
  189. Plugin 'tpope/vim-fugitive'
  190. Plugin 'vim-airline/vim-airline'
  191.  
  192. Plugin 'vim-airline/vim-airline-themes'
  193.  
  194. Plugin 'git://git.wincent.com/command-t.git'
  195. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
  196.  
  197. call vundle#end() " required
  198. filetype plugin indent on " required
  199.  
  200. syntax enable
  201.  
  202. let g:vimtex_view_method = 'zathura'
  203.  
  204. let g:vimtex_view_general_viewer = 'okular'
  205. let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
  206.  
  207. let g:vimtex_compiler_method = 'latexmk'
  208.  
  209. let maplocalleader = ","
  210.  
  211. syntax on
  212.  
  213.  
  214.  
  215. if ! has('gui_running')
  216. set ttimeoutlen=10
  217. augroup FastEscape
  218. autocmd!
  219. au InsertEnter * set timeoutlen=0
  220. au InsertLeave * set timeoutlen=1000
  221. augroup END
  222. endif
  223.  
  224.  
  225. hi Normal guibg=NONE ctermbg=NONE
  226. hi FoldColumn guibg=NONE ctermbg=NONE
  227. hi SignColumn ctermbg=NONE guibg=NONE
  228.  
  229. let g:neosnippet#snippets_directory='~/.vim/plugged/vim-snippets/snippets'
  230.  
  231.  
Advertisement
Add Comment
Please, Sign In to add comment