Update dotfiles

This commit is contained in:
Bogdan Buduroiu 2024-03-06 23:01:53 +08:00
parent 32c83d618b
commit f8e33ed3d0
Signed by: bruvduroiu
GPG key ID: A8722B2334DE9499
3 changed files with 171 additions and 54 deletions

View file

@ -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

View file

@ -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
}
}

192
init.vim
View file

@ -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 <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
let g:airline#extensions#tabline#enabled = 1
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>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 <Esc> <C-\><C-n>
" 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 <c-b> :call OpenTerminal()<CR>
nnoremap <c-b> :FloatermToggle<CR>
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 <C-P> <cmd>Telescope find_files<cr>
nnoremap <C-f> <cmd>Telescope live_grep<cr>
nnoremap <leader>fs <cmd>Telescope grep_string<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" COC namp
"" Remap keys for applying codeAction to the current line.
nmap <leader>ac <Plug>(coc-codeaction)
@ -139,13 +155,34 @@ nmap <silent> ]g <Plug>(coc-diagnostic-next)
nnoremap <silent> <space>d :<C-u>CocList diagnostics<cr>
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
" ===== Old one ====
"inoremap <silent><expr> <TAB>
" \ pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ coc#refresh()
"inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
"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 <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
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 <C-P> :Files<CR>
" 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 <silent> <Leader>= :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
" 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 <silent><script><expr> <S-Tab> copilot#Accept("\<CR>")
nnoremap <silent> <M-]> <Plug>(copilot-next)
nnoremap <silent> <M-[> <Plug>(copilot-prev)
nnoremap <silent> <M-\> <Plug>(copilot-dismiss)
let g:copilot_no_tab_map = v:true
" lua << EOF
" require('llm').setup({
" api_token = nil, -- cf Install paragraph
" model = "stabilityai/stable-code-3b", -- can be a model ID or an http(s) endpoint
" -- parameters that are added to the request body
" query_params = {
" max_new_tokens = 48,
" temperature = 0.2,
" top_p = 0.95,
" stop_token = "<|endoftext|>",
" },
" -- set this if the model supports fill in the middle
" fim = {
" enabled = true,
" prefix = "<fim_prefix>",
" middle = "<fim_middle>",
" suffix = "<fim_suffix>",
" },
" debounce_ms = 150,
" accept_keymap = "<Tab>",
" dismiss_keymap = "<S-Tab>",
" max_context_after = 8192,
" max_context_before = 8192,
" tls_skip_verify_insecure = false,
" -- llm-ls integration
" lsp = {
" enabled = false,
" bin_path = vim.api.nvim_call_function("stdpath", { "data" }) .. "/llm_nvim/bin/llm-ls",
" },
" tokenizer_path = nil, -- when setting model as a URL, set this var
" context_window = 16384, -- max number of tokens for the context window
" })
" EOF
lua << EOF
require('telescope').setup{
defaults = {
theme = "dropdown"
}
}
EOF