update emacs config and reorganize vim config

This commit is contained in:
Julin S 2021-07-31 08:38:46 +05:30
parent f6955bc9a0
commit 17f4d5ef18
5 changed files with 91 additions and 69 deletions

View File

@ -12,6 +12,12 @@
(setq-default word-wrap t)
;; Added with Custom
; Proof general: Change colour of highlighting for executed part (light green)
(custom-set-faces
'(proof-locked-face ((t (:extend t :background "#bcffbd")))))
;; Display current column
; https://www.gnu.org/software/emacs/manual/html_node/efaq/Displaying-the-current-line-or-column.html
(setq column-number-mode t)
@ -71,3 +77,7 @@
(add-hook 'emacs-startup-hook
(lambda ()
(message (format "Emacs started in %s" (emacs-init-time)))))
; Disable automatic indentation
(setq electric-indent-mode nil)

View File

@ -9,7 +9,8 @@ cp mutt/.mailcap $HOME_PATH
cp mutt/.muttrc $HOME_PATH
mkdir -p $HOME_PATH/.vim/
cp vim/digraph_defs.vim $HOME_PATH/.vim/
cp vim/digraphsrc.vim $HOME_PATH/.vim/
cp vim/cscoperc.vim $HOME_PATH/.vim/
cp vim/.vimrc $HOME_PATH
mkdir -p $HOME_PATH/.elinks/

View File

@ -27,75 +27,19 @@ set laststatus=2
" Set color scheme
colo industry
source ~/.vim/digraphsrc.vim
if has("cscope")
" command to execute cscope
set csprg=/usr/bin/cscope
" cscope databases are searched first, followed by tag files
set csto=0
" use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
set cst
" allow relative paths from cscope.out db
set csre
" show message when adding cscope db (cscopeverbose)
set csverb
" add database pointed to by environment
if $CSCOPE_DB != ""
silent cs add $CSCOPE_DB
" else add any database in current directory
elseif filereadable("cscope.out")
silent cs add cscope.out
endif
nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>a :cs find a <C-R>=expand("<cword>")<CR><CR>
" Using 'CTRL-spacebar' then a search type makes the vim window
" split horizontally, with search result displayed in
" the new window.
nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>a :scs find a <C-R>=expand("<cword>")<CR><CR>
" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one
nmap <C-Space><C-Space>s
\:vert scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>g
\:vert scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>c
\:vert scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>t
\:vert scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>e
\:vert scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>i
\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-Space><C-Space>d
\:vert scs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>a
\:vert scs find a <C-R>=expand("<cword>")<CR><CR>
source ~/.vim/cscoperc.vim
endif
source ~/.vim/digraph_defs.vim
" From https://stackoverflow.com/questions/2119754/switch-to-last-active-tab-in-vim
" Switch to last-active tab
if !exists('g:last_tab')
let g:last_tab = 1
let g:last_tab_backup = 1
endif
autocmd! TabLeave * let g:last_tab_backup = g:last_tab | let g:last_tab = tabpagenr()
autocmd! TabClosed * let g:last_tab = g:last_tab_backup
nmap <silent> gl :exe "tabn " . g:last_tab<cr>

67
vim/cscoperc.vim Normal file
View File

@ -0,0 +1,67 @@
" command to execute cscope
set csprg=/usr/bin/cscope
" cscope databases are searched first, followed by tag files
set csto=0
" use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
set cst
" allow relative paths from cscope.out db
set csre
" show message when adding cscope db (cscopeverbose)
set csverb
" add database pointed to by environment
if $CSCOPE_DB != ""
silent cs add $CSCOPE_DB
" else add any database in current directory
elseif filereadable("cscope.out")
silent cs add cscope.out
endif
nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>a :cs find a <C-R>=expand("<cword>")<CR><CR>
" Using 'CTRL-spacebar' then a search type makes the vim window
" split horizontally, with search result displayed in
" the new window.
nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space>a :scs find a <C-R>=expand("<cword>")<CR><CR>
" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one
nmap <C-Space><C-Space>s
\:vert scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>g
\:vert scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>c
\:vert scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>t
\:vert scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>e
\:vert scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>i
\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-Space><C-Space>d
\:vert scs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-Space><C-Space>a
\:vert scs find a <C-R>=expand("<cword>")<CR><CR>