set number set relativenumber set nofoldenable set autoindent " coc.nvim Setup set cmdheight=2 set updatetime=1000 " don't use arrowkeys noremap noremap noremap noremap " really, just don't inoremap inoremap inoremap inoremap call plug#begin("~/.vim/plugged") Plug 'scrooloose/nerdtree' Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'airblade/vim-gitgutter' " Show git diff of lines edited Plug 'tpope/vim-fugitive' " :Gblame Plug 'tpope/vim-rhubarb' " :GBrowse Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'edkolev/tmuxline.vim' " vim-airline compatible tmux bar Plug 'tpope/vim-endwise' " Autocomplete end after a do Plug 'mileszs/ack.vim' " Use ack in Vim Plug 'pangloss/vim-javascript' " JavaScript support Plug 'leafgarland/typescript-vim' " TypeScript syntax Plug 'peitalin/vim-jsx-typescript' Plug 'maxmellon/vim-jsx-pretty' " JS and JSX syntax Plug 'jparise/vim-graphql' " GraphQL syntax Plug 'styled-components/vim-styled-components' Plug 'Yggdroot/indentLine' " Indentation Lines Plug 'APZelos/blamer.nvim' " Git Blame Plug 'kaicataldo/material.vim' " Telescope installation Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.4' } Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } Plug 'christoomey/vim-tmux-navigator' " What it says Plug 'godlygeek/tabular' " Vim Markdown Plug 'preservim/vim-markdown' Plug 'editorconfig/editorconfig-vim' " Keep editors consistent Plug 'fatih/vim-go' " Plug 'huggingface/llm.nvim' " Plug 'bruvduroiu/llm.nvim' Plug 'github/copilot.vim' Plug 'jpalardy/vim-slime', { 'for': 'python' } Plug 'hanschen/vim-ipython-cell', { 'for': 'python' } Plug 'folke/noice.nvim' Plug 'MunifTanjim/nui.nvim' Plug 'rcarriga/nvim-notify' Plug 'CoderCookE/vim-chatgpt' Plug 'jellydn/hurl.nvim' Plug 'ryanoasis/vim-devicons' " Keep this last always call plug#end() autocmd BufEnter *.{js,jsx,ts,tsx,py} :syntax sync fromstart autocmd BufLeave *.{js,jsx,ts,tsx,py} :syntax sync clear set termguicolors syntax enable let g:material_terminal_italics = 1 let g:material_theme_style = "default" let g:airline_theme = 'material' let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#buffer_nr_show = 1 let g:airline#extensions#tabline#formatter = 'unique_tail_improved' colorscheme material " NERDTree on ctrl+n let NERDTreeShowHidden=1 nnoremap n :NERDTreeFocus nnoremap :NERDTree nnoremap :NERDTreeToggle let g:airline#extensions#tabline#enabled = 1 map j map k map h map l " NERDTree config let g:NERDTreeWinPos = "right" let g:NERDTreeWinSize = 45 let g:NERDTreeShowHidden = 1 let g:NERDTreeMinimalUI = 1 let g:NERDTreeDirArrows = 1 let g:NERDTreeIgnore = [] let g:NERDTreeStatusline = '' autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif y " FZF Mapping let g:fzf_action = { \ 'ctrl-t': 'tab split', \ 'ctrl-s': 'split', \ 'ctrl-v': 'vsplit' \} let $FZF_DEFAULT_COMMAND = 'ag -g ""' " Telescope Bindings nnoremap Telescope find_files nnoremap Telescope live_grep nnoremap fs Telescope grep_string nnoremap fb Telescope buffers nnoremap fh Telescope help_tags " COC namp "" Remap keys for applying codeAction to the current line. nmap ac (coc-codeaction) "" Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) "" Rename nmap rn (coc-rename) "" GoTo code navigation. nmap gd (coc-definition) nmap gD :vsplit(coc-definition) nmap gy (coc-type-definition) nmap gY :vsplit(coc-type-definition) nmap gi (coc-implementation) nmap gI :vsplit(coc-implementation) nmap gr (coc-references) nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) nnoremap d :CocList diagnostics nnoremap s :CocList -I symbols " ===== Old one ==== "inoremap " \ pumvisible() ? "\" : " \ check_back_space() ? "\" : " \ coc#refresh() "inoremap coc#pum#visible() ? coc#pum#confirm() "inoremap pumvisible() ? "\" : "\" "function! s:check_back_space() abort " let col = col('.') - 1 " return !col || getline('.')[col - 1] =~# '\s' "endfunction " Use tab for trigger completion with characters ahead and navigate " NOTE: There's always complete item selected by default, you may want to enable " no select by `"suggest.noselect": true` in your configuration file " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config inoremap \ coc#pum#visible() ? coc#pum#next(1) : \ CheckBackspace() ? "\" : \ coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" " Make to accept selected completion item or notify coc.nvim to format " u breaks current undo, please make your own choice inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\" function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction inoremap coc#refresh() nnoremap K :call show_documentation() function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') elseif (coc#rpc#ready()) call CocActionAsync('doHover') else execute '!' . &keywordprg . " " . expand('') endif endfunction function! ShowDocIfNoDiagnostic(timer_id) if (coc#float#has_float() == 0 && CocHasProvider('hover') == 1) silent call CocActionAsync('doHover') endif endfunction function! s:show_hover_doc() call timer_start(200, 'ShowDocIfNoDiagnostic') endfunction autocmd CursorHoldI * :call show_hover_doc() autocmd CursorHold * :call show_hover_doc() " Diagnostics color hi! CocErrorSign guifg=#d1666a hi! CocInfoSign guibg=#353b45 hi! CocWarningSign guifg=#d1cd66 " make FZF respect gitignore if `ag` is installed " you will obviously need to install `ag` for this to work if (executable('ag')) let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""' endif " VimWiki settings set nocompatible filetype plugin on syntax on " COC let let g:coc_global_extensions = [ 'coc-tsserver' ] " ESLint & Prettier if isdirectory('./node_modules') && isdirectory('./node_modules/prettier') let g:coc_global_extensions += ['coc-prettier'] endif if isdirectory('./node_modules') && isdirectory('./node_modules/eslint') let g:coc_global_extensions += ['coc-eslint'] endif let g:typescript_indent_disable = 1 " YAML config " autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab " autocmd FileType ts setlocal ts=2 sts=2 sw=2 expandtab " autocmd FileType js setlocal ts=2 sts=2 sw=2 expandtab " autocmd FileType tf setlocal ts=2 sts=2 sw=2 expandtab " autocmd FileType go setlocal ts=4 sts=4 sw=4 expandtab " autocmd FileType html setlocal ts=4 sts=4 sw=4 expandtab " autocmd FileType md setlocal ts=4 sts=4 sw=4 expandtab " autocmd FileType css setlocal ts=4 sts=4 sw=4 expandtab autocmd FileType json set filetype=jsonc let g:indentLine_char = '⦙' " Increase win size nnoremap = :exe "resize " . (winheight(0) * 3/2) nnoremap - :exe "resize " . (winheight(0) * 2/3) " Python 3 support let g:python3_host_prog = '/Users/bogdanbuduroiu/.pyenv/versions/3.9.16/bin/python' " VIM-GPT Support let g:chat_gpt_max_tokens=2000 let g:chat_gpt_model='gpt-4' let g:chat_gpt_session_mode=1 let g:chat_gpt_temperature=0.7 let g:chat_gpt_lang = 'English' " Noice lua require("noice").setup() lua require("notify").setup({ top_down = false }) " Markdown let g:markdown_fenced_languages = ['html', 'js=javascript', 'ruby', 'python', 'ts=typescript', 'golang'] " Copilot let g:copilot_filetypes = {'python': v:true, 'typescript': v:true, 'yaml': v:true, 'docker': v:true} let b:copilot_enabled = v:true imap