Skip to content
Snippets Groups Projects
Commit d95de7d5 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Add profile default_serial

parent 8294efd2
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,16 @@
# set default profile
export ENVRCD_DEFAULT_PROFILE="default"
# set default profile for `vt*` terminals (serial console)
RGX_SERIAL='^vt'
if [[ ${TERM} =~ ${RGX_SERIAL} ]]; then
export ENVRCD_DEFAULT_PROFILE="default_serial"
fi
unset RGX_SERIAL
# set ENVRCD_COLOR_OFF if we do not want colors
case "$TERM" in
linux|xterm|xterm-color|*-256color) unset ENVRCD_COLOR_OFF;;
linux|xterm|xterm-color|*-256color|vt220) unset ENVRCD_COLOR_OFF;;
*) export ENVRCD_COLOR_OFF="true";;
esac
......
../default/.gitconfig
\ No newline at end of file
../default/.gitignore_global
\ No newline at end of file
" --- general settings ---{{{
" load debian settings from $VIMRUNTIME/debian.vim
runtime! debian.vim
" insert custom path to &runtimepath
let &runtimepath=$ENVRCD_VIM_PATH.','.&runtimepath
syntax on "enable syntax highlighting
set nocompatible "use vim defaults instead of 100% vi compatibility
set encoding=utf8 "default file encoding
set ttyfast "fast terminal
"set mouse=i "enable mouse in insert mode
set mouse= "disable mouse mode
filetype plugin on "enable filetype plugins
filetype indent on "automatic indentation according to filetype
set autoindent "preserve indentation on new line
set backspace=eol,start,indent "allow backspace at end of line etc
set showmatch "show matching parenthesis
set linebreak "break line at end of a word
set textwidth=0 "don't break text after a certain length
set tabstop=4 "show existing tab with 4 spaces width
set shiftwidth=4 "when indenting with '>', use 4 spaces width
set softtabstop=4 "use 4 spaces per tab when editing
set expandtab "when pressing tab, insert 4 spaces
set smarttab "use sw at beginning of line, ts otherwise
set incsearch "incremental search
set wrapscan "continue search from top when reaching the end
set ignorecase "search is not case-sensitive
set smartcase "search case-sensitive for uppercase patterns
set hlsearch "search pattern highlighting
set magic "enable extended regexes
set spellsuggest=7 "show 7 suggestions when spellchecking
set nopaste "fix middlemouse button paste (seems default setting)
set history=999 "increase history (default = 20)
set undolevels=999 "more undo (default=100)
set nobackup "toggle keeping ~ backups of files when saving
set swapfile "use swp file while a file is open
set modeline "scan first/last lines of file for vim commands
set modelines=5 "number of lines checked for modelines
set display=lastline "show beginning of broken line at bottom of window instead of displaying @
set clipboard=unnamed "make all operations such as yy, dd, p work with the clipboard
set wildmenu "show matches for command-line completion
set wildmode=longest:full,full "define how tab completion proceeds on partial match
set wildignore+=*.o,*.pdf "Let tab completion ignore certain file types
set listchars=eol:¬,tab:>-,trail:~,space:· "define replacement for invisible characters (set invlist)
set fillchars=fold:-
" Disable auto-comment after breaking lines with formatoptions
au FileType * setl fo-=c fo-=r fo-=o
"}}}
" --- keyboard mappings ---{{{
" --- map key to toggle opt ---
function MapToggle(key, opt)
let cmd = ':set '.a:opt.'! \| set '.a:opt."?\<CR>"
exec 'nnoremap '.a:key.' '.cmd
exec 'inoremap '.a:key." \<C-O>".cmd
endfunction
command -nargs=+ MapToggle call MapToggle(<f-args>)
" --- toggle mouse=i on/off ---
function ToggleMouse()
if (&mouse == 'i') || (&mouse == 'a')
set mouse=
else
set mouse=i
endif
endfunc
" --- F key toggles ---
" toggle paste mode (normal/insert)
MapToggle <F2> paste
set pastetoggle=<F2>
" toggle mouse mode (normal/insert)
nnoremap <F3> :call ToggleMouse()<CR>
inoremap <F3> <C-O>:call ToggleMouse()<CR>
" paste text at mouse position (insert)
inoremap <MiddleMouse> <LeftMouse><MiddleMouse>
" toggle list mode (normal/insert)
MapToggle <F4> list
" --- normal mappings ---
" toggle paste mode
MapToggle <Leader>p paste
" set mouse modes
nnoremap <Leader>m :set mouse=<CR>
nnoremap <Leader>mi :set mouse=i<CR>
nnoremap <Leader>ma :set mouse=a<CR>
" toggle list of invisible characters
MapToggle <Leader>w list
" remap space to fold/unfold
map <space> za
" remap \s to toggle spellchecking
map <Leader>s :set invspell<CR>
" remap \n to toggle display of line numbers
map <Leader>n :set invnu<CR>
"}}}
" --- vim modeline ---{{{
" vim: set foldmethod=marker:
"}}}
#!/bin/bash
# load the defaults
source_profile_if_exists "${ENVRCD_PATH}/profile/default"
# set the path to this profile
export ENVRCD_PROFILE_PATH="${ENVRCD_PATH}/profile/default_serial"
#!/bin/bash
# --- vim ---
export EDITOR=vim
# source vimrc from cutom location during init
export VIMINIT="source ${ENVRCD_PROFILE_PATH}/.vimrc"
# MYVIMRC: is normally set to the location of the first found vimrc during init
# but when we use VIMINIT to source vimrc, we need to set it manually
export MYVIMRC="${ENVRCD_PROFILE_PATH}/.vimrc"
# profile specific `.vim` directory path for use in `.vimrc` in envrcd
export ENVRCD_VIM_PATH="${ENVRCD_PROFILE_PATH}/.vim"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment