Skip to content

Instantly share code, notes, and snippets.

@rsds143
Last active May 16, 2021 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsds143/f6d1cff61ba4d67ea5f2db980959dd1c to your computer and use it in GitHub Desktop.
Save rsds143/f6d1cff61ba4d67ea5f2db980959dd1c to your computer and use it in GitHub Desktop.
automatically setup a cloud env
"minimal vimrc for basic editing
filetype plugin indent on
"pretty stuff
syntax on
:colorscheme industry
let mapleader = ","
"search for word vim
map <leader>n :execute "noautocmd vimgrep /" . expand("<cword>") . "/j " . vim_working_dir . "**/*." . expand("%:e") <Bar> cw<CR>
"Remove all trailing whitespace by pressing F5
nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
" find files and populate the quickfix list
fun! FindFiles(filename)
let error_file = tempname()
"mac find compat
silent exe '!find . | grep "'.a:filename.'" | xargs file | sed "s/:/:1:/" > '.error_file
"silent exe '!find . -name "'.a:filename.'" | xargs file | sed "s/:/:1:/" > '.error_file
set errorformat=%f:%l:%m
exe "cfile ". error_file
copen
call delete(error_file)
endfun
command! -nargs=1 FindFile call FindFiles(<q-args>)
"map find files
map <leader>f :FindFile
"variable setting
"spell check for md files
autocmd BufRead,BufNewFile *.md setlocal spell spelllang=en_us
"default hide whitespace
set nolist
"tabs and other goods taken from web
set showmode
set hidden
set expandtab
set nowrap " don't wrap lines
set tabstop=4 " a tab is four spaces
set shiftwidth=4 " number of spaces to use for autoindenting
set backspace=indent,eol,start
" allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch " set show matching parenthesis
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
set smarttab " insert tabs on the start of a line according to
" shiftwidth, not tabstop
set hlsearch " highlight search terms
set incsearch " show search matches as you type
set history=1000 " remember more commands and search history
set undolevels=1000 " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title " change the terminal's title
set visualbell " don't beep
set noerrorbells " don't beep
"backup files go away
set nobackup
set noswapfile
set clipboard=unnamed
"search for word working dir setting
let vim_working_dir = fnamemodify('.',':p:p')
"undo support
set undodir=$HOME/.vim/undo
set undolevels=1000
set undoreload=10000
"auto-reload buffers that have changed underneath
set autoread
if !has('gui_running')
set t_Co=256
endif
#!/bin/bash
#todo install git as appropriate
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#doto branch for linux and mac
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install build-essential
brew install gcc
brew tap AdoptOpenJDK/openjdk
brew tap rsds143/rsds
brew install astra-cli sperf go nodejs kubectl k3d k9s helm gh tmux vim mosh wget git
brew install --cask adoptopenjdk11
wget https://gist.githubusercontent.com/rsds143/f6d1cff61ba4d67ea5f2db980959dd1c/raw/fb8f107e03d557d371c9a6079eb1c1834964d459/.vimrc
mv .vimrc $HOME/.vimrc
git clone https://github.com/preservim/nerdtree.git ~/.vim/pack/vendor/start/nerdtree
vim -u NONE -c "helptags ~/.vim/pack/vendor/start/nerdtree/doc" -c q
git clone https://github.com/ctrlpvim/ctrlp.vim.git ~/.vim/pack/vendor/start/ctrlp
git clone https://github.com/Xuyuanp/nerdtree-git-plugin.git ~/.vim/pack/vendor/start/nerdtree-git
git clone https://github.com/fatih/vim-go.git ~/.vim/pack/vendor/start/vim-go
git config --global user.email "tech@foundev.pro"
git config --global user.name "Ryan SVIHLA"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment