Files
dotfiles/portable_vimrc
2024-01-28 14:26:18 -06:00

122 lines
1.9 KiB
Plaintext

filetype plugin indent on
syntax on
"
" Settings
"
set nocompatible
" Scroll when nearing edge of screen
set scrolloff=10
" Read file when edited outside of vim
set autoread
" Hide buffers instead of unload
set hidden
" Autoindent with 4 spaces
set autoindent
set expandtab
set softtabstop=4
set shiftwidth=4
set shiftround
" Show relative numbers and cursorline
set number
set relativenumber
" Search
" Highlight / Ignore Case / Wrap
set incsearch
set hlsearch
set ignorecase
set smartcase
set wrapscan
" Set cursor modes
if exists('$TMUX')
let &t_SI = "\ePtmux;\e\e[6 q\e\\"
let &t_SR = "\ePtmux;\e\e[4 q\e\\"
let &t_EI = "\ePtmux;\e\e[2 q\e\\"
elseif &term =~ "xterm\\|rxvt\\|alacritty"
let &t_SI = "\e[6 q"
let &t_SR = "\e[4 q"
let &t_EI = "\e[2 q"
endif
" Extras
set wildmenu
set backspace=indent,eol,start
set laststatus=2
set display=lastline
set showmode
set showcmd
set updatetime=300
set splitright
set report=0
"
" Keybindings
"
" Make Shift Tab reverse tab
inoremap <S-Tab> <C-d>
" Window Movement Bindings
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"
" Plugins
"
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
Plug 'joshdick/onedark.vim'
Plug 'sheerun/vim-polyglot'
Plug 'vim-airline/vim-airline'
Plug 'dense-analysis/ale'
call plug#end()
let g:ale_completion_enabled=1
let g:airline_section_z=airline#section#create_right(['ln: %l/%c', '%p%%'])
" Setup colorscheme
if (empty($TMUX))
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
set termguicolors
endif
endif
colorscheme onedark