Added bash-support

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2020-11-16 12:54:24 +01:00
parent 5b8989ac04
commit fc7dc3f34a
56 changed files with 12377 additions and 1 deletions

View File

@ -0,0 +1,9 @@
#-----------------------------------------------------------------------
# set Bash prompts
# PS4 shows the function name when execution is inside a function and
# the xtrace option is set.
#-----------------------------------------------------------------------
export PS2='continue> '
export PS3='choose: '
export PS4='|${BASH_SOURCE} ${LINENO}${FUNCNAME[0]:+ ${FUNCNAME[0]}()}| '

View File

@ -0,0 +1,63 @@
"===============================================================================
"
" File: customization.gvimrc
"
" Description: suggestion for a personal configuration file ~/.gvimrc
"
" VIM Version: 7.0+
" Author: Dr. Fritz Mehner (fgm), mehner.fritz@fh-swf.de
" Organization: FH Südwestfalen, Iserlohn
" Version: 1.0
" Created: 18.05.2013 21:58
" Revision: ---
" License: Copyright (c) 2013, Dr. Fritz Mehner
"===============================================================================
"
"===============================================================================
" GENERAL SETTINGS
"===============================================================================
set cmdheight=2 " Make command line two lines high
set mousehide " Hide the mouse when typing text
highlight Normal guibg=grey90
highlight Cursor guibg=Blue guifg=NONE
highlight lCursor guibg=Cyan guifg=NONE
highlight NonText guibg=grey80
highlight Constant gui=NONE guibg=grey95
highlight Special gui=NONE guibg=grey95
"
let c_comment_strings=1 " highlight strings inside C comments
"
"-------------------------------------------------------------------------------
" Moving cursor to other windows
"
" shift down : change window focus to lower one (cyclic)
" shift up : change window focus to upper one (cyclic)
" shift left : change window focus to one on left
" shift right : change window focus to one on right
"-------------------------------------------------------------------------------
nnoremap <s-down> <c-w>w
nnoremap <s-up> <c-w>W
nnoremap <s-left> <c-w>h
nnoremap <s-right> <c-w>l
"
"-------------------------------------------------------------------------------
" some additional hot keys
"-------------------------------------------------------------------------------
" S-F3 - call gvim file browser
"-------------------------------------------------------------------------------
noremap <silent> <s-F3> :silent browse confirm e<CR>
inoremap <silent> <s-F3> <Esc>:silent browse confirm e<CR>
"
"-------------------------------------------------------------------------------
" toggle insert mode <--> 'normal mode with the <RightMouse>-key
"-------------------------------------------------------------------------------
"
nnoremap <RightMouse> <Insert>
inoremap <RightMouse> <ESC>
"
"-------------------------------------------------------------------------------
" use font with clearly distinguishable brackets : ()[]{}
"-------------------------------------------------------------------------------
"set guifont=Luxi\ Mono\ 14
"

View File

@ -0,0 +1,210 @@
"===============================================================================
"
" File: customization.vimrc
"
" Description: suggestion for a personal configuration file ~/.vimrc
"
" VIM Version: 7.0+
" Author: Dr. Fritz Mehner (fgm), mehner.fritz@fh-swf.de
" Organization: FH Südwestfalen, Iserlohn
" Version: 1.0
" Created: 18.05.2013 21:59
" Revision: ---
" License: Copyright (c) 2013, Dr. Fritz Mehner
"===============================================================================
"
"===============================================================================
" GENERAL SETTINGS
"===============================================================================
"-------------------------------------------------------------------------------
" Use Vim settings, rather then Vi settings.
" This must be first, because it changes other options as a side effect.
"-------------------------------------------------------------------------------
set nocompatible
"
"-------------------------------------------------------------------------------
" Enable file type detection. Use the default filetype settings.
" Also load indent files, to automatically do language-dependent indenting.
"-------------------------------------------------------------------------------
filetype plugin on
filetype indent on
"
"-------------------------------------------------------------------------------
" Switch syntax highlighting on.
"-------------------------------------------------------------------------------
syntax on
"
" Platform specific items:
" - central backup directory (has to be created)
" - default dictionary
" Uncomment your choice.
if has("win16") || has("win32") || has("win64") ||
\ has("win95") || has("win32unix")
"
" runtime mswin.vim
" set backupdir =$VIM\vimfiles\backupdir
" set dictionary=$VIM\vimfiles\wordlists/german.list
else
" set backupdir =$HOME/.vim.backupdir
" set dictionary=$HOME/.vim/wordlists/german.list
endif
"
" Using a backupdir under UNIX/Linux: you may want to include a line similar to
" find $HOME/.vim.backupdir -name "*" -type f -mtime +60 -exec rm -f {} \;
" in one of your shell startup files (e.g. $HOME/.profile)
"
"-------------------------------------------------------------------------------
" Various settings
"-------------------------------------------------------------------------------
set autoindent " copy indent from current line
set autoread " read open files again when changed outside Vim
set autowrite " write a modified buffer on each :next , ...
set backspace=indent,eol,start " backspacing over everything in insert mode
set backup " keep a backup file
set browsedir=current " which directory to use for the file browser
set complete+=k " scan the files given with the 'dictionary' option
set history=50 " keep 50 lines of command line history
set hlsearch " highlight the last used search pattern
set incsearch " do incremental searching
set listchars=tab:>.,eol:\$ " strings to use in 'list' mode
set mouse=a " enable the use of the mouse
set nowrap " do not wrap lines
set popt=left:8pc,right:3pc " print options
set ruler " show the cursor position all the time
set shiftwidth=2 " number of spaces to use for each step of indent
set showcmd " display incomplete commands
set smartindent " smart autoindenting when starting a new line
set tabstop=2 " number of spaces that a <Tab> counts for
set visualbell " visual bell instead of beeping
set wildignore=*.bak,*.o,*.e,*~ " wildmenu: ignore these extensions
set wildmenu " command-line completion in an enhanced mode
"
"===================================================================================
" BUFFERS, WINDOWS
"===================================================================================
"
"-------------------------------------------------------------------------------
" The current directory is the directory of the file in the current window.
"-------------------------------------------------------------------------------
if has("autocmd")
autocmd BufNewFile,BufRead * :lchdir %:p:h
endif
"
"-------------------------------------------------------------------------------
" close window (conflicts with the KDE setting for calling the process manager)
"-------------------------------------------------------------------------------
noremap <C-Esc> :close<CR>
inoremap <C-Esc> <C-C>:close<CR>
"
"-------------------------------------------------------------------------------
" Fast switching between buffers
" The current buffer will be saved before switching to the next one.
" Choose :bprevious or :bnext
"-------------------------------------------------------------------------------
noremap <silent> <s-tab> :if &modifiable && !&readonly &&
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
inoremap <silent> <s-tab> <C-C>:if &modifiable && !&readonly &&
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
"
"-------------------------------------------------------------------------------
" Leave the editor with Ctrl-q (KDE): Write all changed buffers and exit Vim
"-------------------------------------------------------------------------------
nnoremap <C-q> :wqall<CR>
"
"-------------------------------------------------------------------------------
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
"-------------------------------------------------------------------------------
if has("autocmd")
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
endif " has("autocmd")
"
"-------------------------------------------------------------------------------
" some additional hot keys
"-------------------------------------------------------------------------------
" F2 - write file without confirmation
" F3 - call file explorer Ex
" F4 - show tag under curser in the preview window (tagfile must exist!)
" F5 - open quickfix error window
" F6 - close quickfix error window
" F7 - display previous error
" F8 - display next error
"-------------------------------------------------------------------------------
"
noremap <silent> <F2> :write<CR>
noremap <silent> <F3> :Explore<CR>
nnoremap <silent> <F4> :exe ":ptag ".expand("<cword>")<CR>
noremap <silent> <F5> :copen<CR>
noremap <silent> <F6> :cclose<CR>
noremap <silent> <F7> :cp<CR>
noremap <silent> <F8> :cn<CR>
"
inoremap <silent> <F2> <Esc>:write<CR>
inoremap <silent> <F3> <Esc>:Explore<CR>
inoremap <silent> <F4> <Esc>:exe ":ptag ".expand("<cword>")<CR>
inoremap <silent> <F5> <Esc>:copen<CR>
inoremap <silent> <F6> <Esc>:cclose<CR>
inoremap <silent> <F7> <Esc>:cp<CR>
inoremap <silent> <F8> <Esc>:cn<CR>
"-------------------------------------------------------------------------------
" autocomplete parenthesis, brackets and braces
"-------------------------------------------------------------------------------
inoremap ( ()<Left>
inoremap [ []<Left>
inoremap { {}<Left>
"
vnoremap ( s()<Esc>P
vnoremap [ s[]<Esc>P
vnoremap { s{}<Esc>P
"
"-------------------------------------------------------------------------------
" autocomplete quotes
"-------------------------------------------------------------------------------
vnoremap ' s''<Esc>P<Right>
vnoremap " s""<Esc>P<Right>
vnoremap ` s``<Esc>P<Right>
"
inoremap ' '<Esc>:call QuoteInsertionWrapper("'")<CR>a
inoremap " "<Esc>:call QuoteInsertionWrapper('"')<CR>a
inoremap ` `<Esc>:call QuoteInsertionWrapper('`')<CR>a
"
"-------------------------------------------------------------------------------
" function QuoteInsertionWrapper {{{3
"
" Add a second quote only if the left and the right character are not keyword
" characters and the right character is not the same quote.
"-------------------------------------------------------------------------------
function! QuoteInsertionWrapper (quote)
let col = col('.')
let line = getline('.')
if ( line[col-2] =~ '\k' )
\ || ( line[col ] =~ '\k' )
\ || ( line[col-2] =~ a:quote )
\ || ( line[col ] =~ a:quote )
return a:quote
else
return a:quote.a:quote."\<Left>"
endif
endfunction
"
"===============================================================================
" VARIOUS PLUGIN CONFIGURATIONS
"===============================================================================
"
"-------------------------------------------------------------------------------
" plugin bash-support.vim
"-------------------------------------------------------------------------------
" --empty --
"
"-------------------------------------------------------------------------------
" taglist.vim : toggle the taglist window
"-------------------------------------------------------------------------------
noremap <silent> <F11> <Esc><Esc>:Tlist<CR>
inoremap <silent> <F11> <Esc><Esc>:Tlist<CR>

View File

@ -0,0 +1,16 @@
§ =============================================================
§ User Macros
§ =============================================================
SetMacro( 'AUTHOR', 'YOUR NAME' )
SetMacro( 'AUTHORREF', '' )
SetMacro( 'COMPANY', '' )
SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' )
SetMacro( 'EMAIL', '' )
SetMacro( 'LICENSE', 'GNU General Public License' )
SetMacro( 'ORGANIZATION','' )
§ =============================================================
§ File Includes and Shortcuts
§ =============================================================

View File

@ -0,0 +1,35 @@
"===============================================================================
"
" File: sh.vim
"
" Description: Additonal maps for bash-support (version 4.0+)
"
" VIM Version: 7.0+
" Author: Dr. Fritz Mehner (fgm), mehner.fritz@fh-swf.de
" Organization: FH Südwestfalen, Iserlohn
" Version: 1.0
" Created: 20.05.2013 17:20
" Revision: ---
" License: Copyright (c) 2013, Dr. Fritz Mehner
"===============================================================================
"
"-------------------------------------------------------------------------------
" additional mapping : single quotes around a Word (non-whitespaces)
" masks the normal mode command '' (jump to the position
" before the latest jump)
" additional mapping : double quotes around a Word (non-whitespaces)
"-------------------------------------------------------------------------------
nnoremap <buffer> '' ciW''<Esc>P
nnoremap <buffer> "" ciW""<Esc>P
"
"-------------------------------------------------------------------------------
" generate tests
" additional mapping : \t1 expands to [ -<CURSOR> ]
" additional mapping : \t2 expands to [ <CURSOR> - ]
"-------------------------------------------------------------------------------
nnoremap <buffer> <silent> <LocalLeader>t1 a[ - ]<Left><Left><Left>
inoremap <buffer> <silent> <LocalLeader>t1 [ - ]<Left><Left><Left>
"
nnoremap <buffer> <silent> <LocalLeader>t2 a[ - ]<Left><Left><Left><Left><Left>
inoremap <buffer> <silent> <LocalLeader>t2 [ - ]<Left><Left><Left><Left><Left>
"