--- /dev/null
+# User dependent .bashrc file
+
+# If not running interactively, don't do anything
+[[ "$-" != *i* ]] && return
+
+# Load settings
+for file in ${HOME}/.config/bash/rc/*; do
+ [ -f "$file" ] && source "$file";
+done;
+
+# Local/private settings
+[ -f "${HOME}/.config/bash/bashrc_local" ] && source "${HOME}/.config/bash/bashrc_local"
+++ /dev/null
-# User dependent .bashrc file
-
-# If not running interactively, don't do anything
-[[ "$-" != *i* ]] && return
-
-# Determine host platform
-if [ "$(uname)" == "SunOS" ]; then
- PLATFORM="SunOS";
-elif [ "$(uname)" == "Darwin" ]; then
- PLATFORM="Darwin";
-elif [ "$(uname -o)" == "GNU/Linux" ]; then
- PLATFORM="Linux";
-elif [ "$(uname -o)" == "Msys" ]; then
- PLATFORM="Msys";
-elif [ "$(uname -o)" == "Cygwin" ]; then
- PLATFORM="Cygwin";
-else
- PLATFORM="Unknown";
-fi
-export PLATFORM
-echo Now running on $PLATFORM platform
-
-
-# Load settings
-for file in ${HOME}/.config/bash/rc/*; do
- [ -f "$file" ] && source "$file";
-done;
-
-# Local/private settings
-[ -f "${HOME}/.config/bash/bashrc_local" ] && source "${HOME}/.config/bash/bashrc_local"
# Make vim the default editor
export EDITOR="vim";
export VISUAL="vim";
-export MYVIMRC="$HOME/.config/vim/vimrc"
+#export MYVIMRC="$HOME/.config/vim/vimrc"
# Larger bash history (allow 32³ entries; default is 500)
export HISTSIZE=32768;
+++ /dev/null
-# Platform specific
-if [ "$PLATFORM" == "Msys" ]; then
- # Mount the portable Documents folder, if it isn't already
- if [ ! -d Documents ]; then
- mount "${USBDRV}\Documents" "${HOME}/Documents";
- fi
-fi
-
-if [ "$PLATFORM" == "Cygwin" ]; then
- # Mount the portable Documents folder, if it isn't already
- if [ ! -d Documents ]; then
- mount -f -o noacl,posix=0 ${USBDRV}/Documents ${HOME}/Documents;
- fi
-fi
+++ /dev/null
-set nocompatible
-set directory=$HOME/.cache/vim/swap
-set backupdir=$HOME/.cache/vim/backup
-set undodir=$HOME/.cache/vim/undo
-set viminfo+=n$HOME/.local/share/vim/viminfo
-"set rtp=~/$HOME/.config/vim,~/$HOME/.config/vim/after,$VIM,$VIMRUNTIME
-
-if empty(glob('$HOME/.config/vim/autoload/plug.vim'))
- silent !mkdir -p $HOME/.cache/vim/swap > /dev/null 2>&1
- silent !mkdir -p $HOME/.cache/vim/backup > /dev/null 2>&1
- silent !mkdir -p $HOME/.cache/vim/undo > /dev/null 2>&1
- silent !curl -fLo $HOME/.config/vim/autoload/plug.vim --create-dirs
- \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- autocmd VimEnter * PlugInstall | source $MYVIMRC
-endif
-
-if filereadable(expand('$HOME/.config/vim/autoload/plug.vim'))
-source $HOME/.config/vim/autoload/plug.vim
-call plug#begin('$HOME/.config/vim/plugged')
-
-"Plug 'tpope/vim-sensible'
-"Plug 'tpope/vim-ragtag'
-Plug 'tpope/vim-repeat'
-Plug 'tpope/vim-surround'
-Plug 'tpope/vim-fugitive'
-"Plug 'vim-airline/vim-airline'
-"Plug 'vim-airline/vim-airline-themes'
-"Plug 'mileszs/ack.vim'
-Plug 'brandonbloom/csearch.vim'
-Plug 'chazy/cscope_maps'
-Plug 'majutsushi/tagbar'
-"Plug 'airblade/vim-gitgutter'
-Plug 'junegunn/fzf.vim'
-Plug 'thanthese/Tortoise-Typing'
-Plug 'altercation/vim-colors-solarized'
-Plug 'editorconfig/editorconfig-vim'
-Plug 'scrooloose/nerdtree'
-Plug 'vim-scripts/a.vim'
-
-call plug#end()
-endif
-
-" Section: Options {{{1
-" ---------------------
-
-set autoindent
-set autoread
-set autowrite " Automatically save before commands like :next and :make
-set backspace=2
-if exists('+breakindent')
- set breakindent showbreak=\ +
-endif
-set cmdheight=2
-setglobal commentstring=#\ %s
-set complete-=i " Searching includes can be slow
-set fileformats=unix,dos,mac
-set foldmethod=marker
-set foldopen+=jump
-set history=200
-set incsearch " Incremental search
-set laststatus=2 " Always show status line
-set lazyredraw
-set linebreak
-set mouse=nvi
-set mousemodel=popup
-set pastetoggle=<F2>
-set printoptions=paper:letter
-set scrolloff=1
-set shiftround
-set showcmd " Show (partial) command in status line.
-set showmatch " Show matching brackets.
-set sidescrolloff=5
-set smartcase " Case insensitive searches become sensitive with capitals
-set smarttab " sw at the start of the line, sts everywhere else
-setglobal tags=./tags;
-set timeoutlen=1200 " A little bit more time for macros
-set ttimeoutlen=50 " Make Esc work faster
-if exists('+undofile')
- set undofile
-endif
-"set nobackup
-set visualbell
-set virtualedit=block
-set wildmenu
-set wildmode=longest:full,full
-set wildignore+=tags,.*.un~,*.pyc
-set winaltkeys=no
-
-if !has("gui_running") && $DISPLAY == '' || !has("gui")
- set mouse=
-endif
-set background=light
-set number
-
-" Plugin Settings {{{2
-
-
-let g:solarized_menu=0
-let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
-let g:markdown_syntax_conceal = 0
-
-" %s is replaced with fzf command
-"let g:fzf_launcher = 'xterm -e bash -ic %s'
-let g:fzf_launcher = "In_a_new_term_function %s"
-
-"For airline
-"let g:airline#extensions#tabline#enabled = 1
-
-let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
-let g:EditorConfig_verbose=0
-let g:NERDTreeWinSize=30
-
-" }}}2
-" Section: Commands {{{1
-"-----------------------
-"
-if has("cscope")
- set nocscopetag
- set cscopequickfix=s-,c-,d-,i-,t-,e-
- set nocscopeverbose
- if filereadable(".git/cscope.out")
- cscope add .git/cscope.out
- endif
- set cscopeverbose
-
- nnoremap <Leader>fs :cscope find s <C-R>=expand("<cword>")<CR><CR>:botright cwindow<CR>
- nnoremap <Leader>fg :cscope find g <C-R>=expand("<cword>")<CR><CR>:botright cwindow<CR>
- nnoremap <Leader>fc :cscope find c <C-R>=expand("<cword>")<CR><CR>:botright cwindow<CR>
- nnoremap <Leader>ft :cscope find t <C-R>=expand("<cword>")<CR><CR>:botright cwindow<CR>
- nnoremap <Leader>fe :cscope find e <C-R>=expand("<cword>")<CR><CR>:botright cwindow<CR>
- nnoremap <Leader>ff :cscope find f <C-R>=expand("<cfile>")<CR><CR>:botright cwindow<CR>
- nnoremap <Leader>fd :cscope find d <C-R>=expand("<cword>")<CR><CR>:botright cwindow<CR>
- nnoremap <Leader>fi :cscope find i ^<C-R>=expand("<cfile>")<CR>$<CR>:botright cwindow<CR>
- "TODO: figure out how to get cstag output in quickfix or a popup menu.
- map <C-_> :cstag <C-R>=expand("<cword>")<CR><CR>
-
- function! CscopeRebuild()
- cscope kill .git/cscope.out
- silent execute "!./.git/hooks/cscope"
- if v:shell_error
- redraw!
- echohl ErrorMsg | echo "Unable to run cscope command." | echohl None
- else
- if filereadable(".git/cscope.out")
- redraw!
- cscope add .git/cscope.out
- else
- redraw!
- echohl ErrorMsg | echo "Unable to read cscope database." | echohl None
- endif
- endif
- endfunction
-
- command! Cscope call CscopeRebuild()
-endif"
-"
-"
-" Section: Mappings {{{1
-" ----------------------
-
-inoremap jj <ESC>
-inoremap j<Space> j
-map <F1> <Esc>
-map! <F1> <Esc>
-if has("gui_running")
- map <F2> :Fancy<CR>
-endif
-nmap <silent> <F6> :if &previewwindow<Bar>pclose<Bar>elseif exists(':Gstatus')<Bar>exe 'Gstatus'<Bar>else<Bar>ls<Bar>endif<CR>
-nmap <silent> <F7> :if exists(':Lcd')<Bar>exe 'Lcd'<Bar>elseif exists(':Cd')<Bar>exe 'Cd'<Bar>else<Bar>lcd %:h<Bar>endif<CR>
-map <F8> :Make<CR>
-map <F9> :Dispatch<CR>
-map <F10> :Start<CR>
-map <Leader>v :so ~/.vimrc<CR>
-
-
-" Section: Autocommands {{{1
-" --------------------------
-if has("autocmd")
- filetype plugin indent on
-autocmd BufNewFile,BufReadPost *.md set filetype=markdown
-endif " has("autocmd")
-" }}}1
-" Section: Visual {{{1
-" --------------------
-
-" Switch syntax highlighting on, when the terminal has colors
-if (&t_Co > 2 || has("gui_running")) && has("syntax")
- function! s:initialize_font()
- if exists("&guifont")
- if has("mac")
- set guifont=Monaco:h12
- elseif has("unix")
- if &guifont == ""
- set guifont=Monospace\ Medium\ 12
- endif
- elseif has("gtk2")
- set guifont=Inconsolata\ 12
- elseif has("win32")
- set guifont=Consolas:h11,Courier\ New:h10
- endif
- endif
- endfunction
-
-
- if exists("syntax_on") || exists("syntax_manual")
- else
- syntax on
- endif
- set list
- if !exists('g:colors_name')
- silent! colorscheme solarized
- endif
- endif
-" }}}1
-
-if filereadable(expand('$HOME/.config/vim/vimrc_local'))
- source $HOME/.config/vim/vimrc_local
-endif
# if running bash
if [ -n "${BASH_VERSION}" ]; then
# source the users bashrc if it exists
- [ -f "${HOME}/.config/bash/bashrc" ] && source "${HOME}/.config/bash/bashrc"
+ [ -f "${HOME}/.bashrc" ] && source "${HOME}/.bashrc"
fi
-" ~/.vimrc
+set nocompatible
+set runtimepath+=$HOME/.config/vim
+set directory=$HOME/.cache/vim/swap
+set backupdir=$HOME/.cache/vim/backup
+set undodir=$HOME/.cache/vim/undo
+set viminfo+=n$HOME/.local/share/vim/viminfo
-source $HOME/.config/vim/vimrc
+if empty(glob('$HOME/.config/vim/autoload/plug.vim'))
+ silent !mkdir -p $HOME/.cache/vim/swap > /dev/null 2>&1
+ silent !mkdir -p $HOME/.cache/vim/backup > /dev/null 2>&1
+ silent !mkdir -p $HOME/.cache/vim/undo > /dev/null 2>&1
+ silent !curl -fLo $HOME/.config/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('$HOME/.config/vim/plugged')
+
+"Plug 'tpope/vim-sensible'
+"Plug 'tpope/vim-ragtag'
+Plug 'tpope/vim-repeat'
+Plug 'tpope/vim-surround'
+Plug 'tpope/vim-fugitive'
+"Plug 'vim-airline/vim-airline'
+"Plug 'vim-airline/vim-airline-themes'
+"Plug 'mileszs/ack.vim'
+Plug 'brandonbloom/csearch.vim'
+Plug 'chazy/cscope_maps'
+Plug 'majutsushi/tagbar'
+"Plug 'airblade/vim-gitgutter'
+Plug 'junegunn/fzf.vim'
+Plug 'thanthese/Tortoise-Typing'
+Plug 'altercation/vim-colors-solarized'
+Plug 'editorconfig/editorconfig-vim'
+Plug 'scrooloose/nerdtree'
+Plug 'vim-scripts/a.vim'
+
+call plug#end()
+
+" section: options {{{1
+" ---------------------
+
+set autoindent
+set autoread
+set autowrite " automatically save before commands like :next and :make
+set backspace=2
+if exists('+breakindent')
+ set breakindent showbreak=\ +
+endif
+set cmdheight=2
+setglobal commentstring=#\ %s
+set complete-=i " searching includes can be slow
+set fileformats=unix,dos,mac
+set foldmethod=marker
+set foldopen+=jump
+set history=200
+set incsearch " incremental search
+set laststatus=2 " always show status line
+set lazyredraw
+set linebreak
+set mouse=nvi
+set mousemodel=popup
+set pastetoggle=<f2>
+set printoptions=paper:letter
+set scrolloff=1
+set shiftround
+set showcmd " show (partial) command in status line.
+set showmatch " show matching brackets.
+set sidescrolloff=5
+set smartcase " case insensitive searches become sensitive with capitals
+set smarttab " sw at the start of the line, sts everywhere else
+setglobal tags=./tags;
+set timeoutlen=1200 " a little bit more time for macros
+set ttimeoutlen=50 " make esc work faster
+set visualbell
+if exists('+undofile')
+ set undofile
+endif
+set virtualedit=block
+set wildmenu
+set wildmode=longest:full,full
+set wildignore+=tags,.*.un~,*.pyc
+set winaltkeys=no
+
+if !has("gui_running") && $display == '' || !has("gui")
+ set mouse=
+endif
+set background=light
+set number
+
+" plugin settings {{{2
+
+
+let g:solarized_menu=0
+let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
+let g:markdown_syntax_conceal = 0
+
+" %s is replaced with fzf command
+"let g:fzf_launcher = 'xterm -e bash -ic %s'
+let g:fzf_launcher = "in_a_new_term_function %s"
+
+"for airline
+"let g:airline#extensions#tabline#enabled = 1
+
+let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
+let g:editorconfig_verbose=0
+let g:nerdtreewinsize=30
+
+" }}}2
+" section: commands {{{1
+"-----------------------
+"
+if has("cscope")
+ set nocscopetag
+ set cscopequickfix=s-,c-,d-,i-,t-,e-
+ set nocscopeverbose
+ if filereadable(".git/cscope.out")
+ cscope add .git/cscope.out
+ endif
+ set cscopeverbose
+
+ nnoremap <leader>fs :cscope find s <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fg :cscope find g <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fc :cscope find c <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>ft :cscope find t <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fe :cscope find e <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>ff :cscope find f <c-r>=expand("<cfile>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fd :cscope find d <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fi :cscope find i ^<c-r>=expand("<cfile>")<cr>$<cr>:botright cwindow<cr>
+ "todo: figure out how to get cstag output in quickfix or a popup menu.
+ map <c-_> :cstag <c-r>=expand("<cword>")<cr><cr>
+
+ function! Cscoperebuild()
+ cscope kill .git/cscope.out
+ silent execute "!./.git/hooks/cscope"
+ if v:shell_error
+ redraw!
+ echohl errormsg | echo "unable to run cscope command." | echohl none
+ else
+ if filereadable(".git/cscope.out")
+ redraw!
+ cscope add .git/cscope.out
+ else
+ redraw!
+ echohl errormsg | echo "unable to read cscope database." | echohl none
+ endif
+ endif
+ endfunction
+
+ command! Cscope call Cscoperebuild()
+endif"
+"
+"
+" section: mappings {{{1
+" ----------------------
+
+inoremap jj <esc>
+inoremap j<space> j
+map <f1> <esc>
+map! <f1> <esc>
+if has("gui_running")
+ map <f2> :fancy<cr>
+endif
+nmap <silent> <f6> :if &previewwindow<bar>pclose<bar>elseif exists(':gstatus')<bar>exe 'gstatus'<bar>else<bar>ls<bar>endif<cr>
+nmap <silent> <f7> :if exists(':lcd')<bar>exe 'lcd'<bar>elseif exists(':cd')<bar>exe 'cd'<bar>else<bar>lcd %:h<bar>endif<cr>
+map <f8> :make<cr>
+map <f9> :dispatch<cr>
+map <f10> :start<cr>
+map <leader>v :so ~/.vimrc<cr>
+
+
+" section: autocommands {{{1
+" --------------------------
+if has("autocmd")
+ filetype plugin indent on
+autocmd bufnewfile,bufreadpost *.md set filetype=markdown
+endif " has("autocmd")
+" }}}1
+" section: visual {{{1
+" --------------------
+
+" switch syntax highlighting on, when the terminal has colors
+if (&t_Co > 2 || has("gui_running")) && has("syntax")
+ function! s:initialize_font()
+ if exists("&guifont")
+ if has("mac")
+ set guifont=monaco:h12
+ elseif has("unix")
+ if &guifont == ""
+ set guifont=monospace\ medium\ 12
+ endif
+ elseif has("gtk2")
+ set guifont=inconsolata\ 12
+ elseif has("win32")
+ set guifont=consolas:h11,courier\ new:h10
+ endif
+ endif
+ endfunction
+
+
+ if exists("syntax_on") || exists("syntax_manual")
+ else
+ syntax on
+ endif
+ set list
+ if !exists('g:colors_name')
+ silent! colorscheme solarized
+ endif
+ endif
+" }}}1
+
+if filereadable(expand('$HOME/.config/vim/vimrc_local'))
+ source $HOME/.config/vim/vimrc_local
+endif