Last active
February 26, 2024 19:10
-
-
Save prometheusaiolos/c9668c2e7351c76a73bd0c9a2102e0da to your computer and use it in GitHub Desktop.
my development setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Set basic Vim options | |
set nocompatible " Use Vim defaults | |
set number " Show line numbers | |
set relativenumber " Show relative line numbers | |
set showcmd " Show command in bottom bar | |
set cursorline " Highlight current line | |
set wrap " Enable line wrap | |
set tabstop=4 " Number of spaces tabs count for | |
set shiftwidth=4 " Width for autoindents | |
set expandtab " Converts tabs to spaces | |
set smartindent " Autoindent new lines | |
set ignorecase " Case insensitive searching | |
set smartcase " Case sensitive when search includes uppercase | |
set backspace=indent,eol,start " More intuitive backspacing | |
set history=50 " Keep 50 lines of command line history | |
set ruler " Show the cursor position | |
set wildmenu " Visual autocomplete for command menu | |
set lazyredraw " Redraw only when necessary | |
set incsearch " Incremental search | |
set hlsearch " Highlight search matches | |
" Enhanced command line completion | |
set wildmode=list:longest | |
" Better copy & paste | |
set clipboard=unnamedplus | |
" Split windows more intuitively | |
set splitbelow | |
set splitright | |
" Install vim-plug if not already installed | |
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall | source $MYVIMRC | |
endif | |
call plug#begin('~/.vim/plugged') | |
" Plugins for file and window management | |
Plug 'preservim/nerdtree' | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'tpope/vim-obsession' | |
" Enhanced status line | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
" Git integration | |
Plug 'tpope/vim-fugitive' | |
Plug 'airblade/vim-gitgutter' | |
" Language-specific plugins | |
Plug 'pangloss/vim-javascript' | |
Plug 'leafgarland/typescript-vim' | |
Plug 'maxmellon/vim-jsx-pretty' | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } | |
Plug 'vim-python/python-syntax' | |
Plug 'octol/vim-cpp-enhanced-highlight' | |
" coc.nvim language server extensions | |
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'} | |
Plug 'neoclide/coc-json', {'do': 'yarn install --frozen-lockfile'} | |
Plug 'neoclide/coc-python', {'do': 'yarn install --frozen-lockfile'} | |
Plug 'neoclide/coc-git', {'do': 'yarn install --frozen-lockfile'} | |
" Additional functionality | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'tpope/vim-surround' | |
Plug 'jiangmiao/auto-pairs' | |
Plug 'easymotion/vim-easymotion' | |
Plug 'junegunn/goyo.vim' | |
Plug 'junegunn/limelight.vim' | |
Plug 'vim-syntastic/syntastic' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'mhinz/vim-startify' | |
Plug 'itchyny/lightline.vim' | |
" Color schemes | |
Plug 'morhetz/gruvbox' | |
Plug 'joshdick/onedark.vim' | |
Plug 'dracula/vim', { 'as': 'dracula' } | |
call plug#end() | |
" Set color scheme after plugins are loaded to avoid errors | |
autocmd VimEnter * colorscheme dracula | |
" NERDTree settings | |
nmap <C-n> :NERDTreeToggle<CR> | |
autocmd vimenter * NERDTree | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree")) | q | endif | |
" FZF settings | |
nmap <C-p> :Files<CR> | |
" Language specific settings | |
autocmd FileType javascript setlocal ts=2 sw=2 expandtab | |
autocmd FileType python setlocal ts=4 sw=4 expandtab | |
autocmd FileType go setlocal ts=4 sw=4 noexpandtab | |
autocmd FileType c, cpp setlocal ts=4 sw=4 expandtab | |
" vim-airline configuration | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline_theme='dark' | |
" coc.nvim configurations | |
" General settings | |
inoremap <silent><expr> <TAB> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>" | |
inoremap <silent><expr> <S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>" | |
" Use `[g` and `]g` to navigate diagnostics | |
nmap <silent> [g <Plug>(coc-diagnostic-prev) | |
nmap <silent> ]g <Plug>(coc-diagnostic-next) | |
" Other custom Vim settings | |
" Add your personal preferences here | |
" Enable filetype plugins | |
filetype plugin indent on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment