Skip to content

Instantly share code, notes, and snippets.

@madmann91
Last active March 29, 2024 12:06
Show Gist options
  • Save madmann91/29416e71d147dd03be5abc87003db238 to your computer and use it in GitHub Desktop.
Save madmann91/29416e71d147dd03be5abc87003db238 to your computer and use it in GitHub Desktop.
Setup environment (requires fish + git + curl + Fira Code)
#!/bin/sh
# Install vim-plug and create vim config
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "syntax enable
"\"" Avoid problems when pressing Q by error (Dvorak layout)
map Q <Nop>
"\"" Allow executing local .vimrc files
set exrc
set secure
"\"" Hide toolbar and menubar in GVim and set font
set guioptions-=m
set guioptions-=T
set guifont=Fira\ Code\ 13
"\"" Do not insert two spaces ' ' when merging sentences or formatting paragraphs
set nojoinspaces
"\"" Opening new buffers hides existing ones
set hidden
set tabstop=4
set softtabstop=4
set shiftwidth=0 "\"" Always use the same value as tabstop
set expandtab
set number
set cursorline
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'cocopon/iceberg.vim'
Plug 'w0rp/ale'
call plug#end()
"\"" Common abbreviations for FZF
command T Tags
command F Files
command B Buffers
"\"" Prevent errors for C99 compound literals
let c_no_curly_error = 1
"\"" Color scheme
set background=dark
if exists('+termguicolors')
let &t_8f = \"\<Esc>[38;2;%lu;%lu;%lum\"
let &t_8b = \"\<Esc>[48;2;%lu;%lu;%lum\"
set termguicolors
endif" > ~/.vimrc
vim +PlugUpdate +qall
echo "colorscheme iceberg" >> ~/.vimrc
# Set up fish
echo "set fish_greeting
fish_vi_key_bindings" > ~/.config/fish/config.fish
# Set up tmux
echo "set-option -g default-shell $(which fish)
set-window-option -g mode-keys vi
set -g default-terminal \"tmux-256color\"
set -ga terminal-overrides \",*256col*:Tc\"" > ~/.tmux.conf
# Set up git
git config --global credential.helper cache
git config --global pull.rebase true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment