From f8e33ed3d002470cfc41a6edcaa636fab893315c Mon Sep 17 00:00:00 2001 From: Bogdan Buduroiu Date: Wed, 6 Mar 2024 23:01:53 +0800 Subject: [PATCH] Update dotfiles --- alacritty.yml | 8 +- coc-settings.json | 25 +++++- init.vim | 192 +++++++++++++++++++++++++++++++++++----------- 3 files changed, 171 insertions(+), 54 deletions(-) diff --git a/alacritty.yml b/alacritty.yml index 91b9ad7..81301a7 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -21,7 +21,7 @@ env: # each instance of Alacritty. If it is not present, alacritty will # check the local terminfo database and use `alacritty` if it is # available, otherwise `xterm-256color` is used. - TERM: alacritty + TERM: xterm-256color window: # Window dimensions (changes require restart) @@ -62,7 +62,7 @@ window: # Values for `decorations` (macOS only): # - transparent: Title bar, transparent background and title bar buttons # - buttonless: Title bar, transparent background and no title bar buttons - decorations: none + decorations: none # Background opacity # @@ -438,8 +438,8 @@ font: # Default: # - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset # - (Windows) powershell -#shell: -# program: /bin/bash +# shell: +# program: /usr/local/bin/fish # args: # - --login diff --git a/coc-settings.json b/coc-settings.json index 91aa85f..36e0e1d 100644 --- a/coc-settings.json +++ b/coc-settings.json @@ -4,15 +4,21 @@ "eslint.filetypes": ["javascript", "javascriptreact", "typescript", "typescriptreact"], "prettier.disableSuccessMessage": true, "coc.preferences.diagnostic.virtualText": true, + "coc.preferences.rootPatterns": [".git"," poetry.lock"," package-lock.json"], "coc.preferences.formatOnSaveFiletypes": [ - "javascript", - "javascriptreact", + "html", "typescript", + "javascriptreact", "typescriptreact", + "json", + "graphql", + "handlebars", "tf", "ts", "terraform", - "go" + "go", + "python", + "cpp" ], "tsserver.formatOnType": false, "coc.preferences.formatOnType": false, @@ -34,6 +40,17 @@ } }, "yaml.schemas": { - "kubernetes": "/*.yaml" + "https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json": "**/docker-compose*.y*ml" + }, + "python": { + "formatting": { + "provider": "none" + }, + "poetryPath": "poetry", + "pythonPath": "python", + "venvPath": ".venv" + }, + "ruff": { + "enable": true } } diff --git a/init.vim b/init.vim index 21646b3..a368618 100644 --- a/init.vim +++ b/init.vim @@ -1,5 +1,6 @@ set number set relativenumber +set nofoldenable set autoindent " coc.nvim Setup @@ -40,32 +41,57 @@ Plug 'maxmellon/vim-jsx-pretty' " JS and JSX syntax Plug 'jparise/vim-graphql' " GraphQL syntax Plug 'styled-components/vim-styled-components' -Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } -Plug 'junegunn/fzf.vim' - Plug 'Yggdroot/indentLine' " Indentation Lines Plug 'APZelos/blamer.nvim' " Git Blame Plug 'kaicataldo/material.vim' -Plug 'voldikss/vim-floaterm' " Floaterm +" 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 -if (has("termguicolors")) - set termguicolors -endif +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 @@ -73,14 +99,14 @@ let NERDTreeShowHidden=1 nnoremap n :NERDTreeFocus nnoremap :NERDTree nnoremap :NERDTreeToggle -nnoremap :NERDTreeFind +let g:airline#extensions#tabline#enabled = 1 map j map k map h map l " NERDTree config -let g:NERDTreeWinPos = 1 " open on right +let g:NERDTreeWinPos = "right" let g:NERDTreeWinSize = 45 let g:NERDTreeShowHidden = 1 let g:NERDTreeMinimalUI = 1 @@ -88,24 +114,7 @@ let g:NERDTreeDirArrows = 1 let g:NERDTreeIgnore = [] let g:NERDTreeStatusline = '' autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - -" Integrated Terminal -" open new split panes to right and below -set splitright -set splitbelow -" turn terminal to normal mode with escape -" tnoremap -" start terminal in insert mode -au BufEnter * if &buftype == 'terminal' | :startinsert | endif -" open terminal on ctrl+n -"function! OpenTerminal() -" split term://fish -" resize 10 -"endfunction -"nnoremap :call OpenTerminal() -nnoremap :FloatermToggle -let g:floaterm_wintype = 'split' - +y " FZF Mapping let g:fzf_action = { \ 'ctrl-t': 'tab split', @@ -114,6 +123,13 @@ let g:fzf_action = { \} 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) @@ -139,13 +155,34 @@ 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 - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() + \ 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() -inoremap pumvisible() ? "\" : "\" -function! s:check_back_space() abort + \: "\u\\=coc#on_enter()\" + +function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction @@ -187,17 +224,11 @@ if (executable('ag')) let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""' endif -nnoremap :Files - " VimWiki settings set nocompatible filetype plugin on syntax on - - " VimWiki let -let g:vimwiki_list = [{'path': '~/Nextcloud/vimwiki/', 'ext': '.md'}] - " COC let let g:coc_global_extensions = [ 'coc-tsserver' ] @@ -213,17 +244,86 @@ 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=2 sts=2 sw=2 expandtab +" 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) -" Airline nvim -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#formatter = 'unique_tail_improved' +" 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