rc files

From Fluids Wiki
Revision as of 11:19, 3 August 2018 by Bastorer (talk | contribs) (Created page with " This page contains some configuration (rc) files for various programs. They provide default settings and functionality. For example, the vimrc file turns syntax highlightin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page contains some configuration (rc) files for various programs. They provide default settings and functionality. For example, the vimrc file turns syntax highlighting on by default and specifies the colour scheme.

These have slowly developed through additions from various lab members, so if you have something that you think would be a useful addition, consider adding it!

Of course, how you configure your programs comes down to personal preference, so feel free to modify however you wish.

vimrc

If you're new to Vim, copy the following into ~/.vimrc to set some useful default settings.

:set ruler

" Turn on syntax highlighting
:syntax enable
:colorscheme desert
:au Syntax python :set autoindent
:au Syntax c :set noautoindent
:au Syntax c :set cindent
:au Syntax cpp :set noautoindent
:au Syntax cpp :set cindent

set backspace=indent,eol,start
set laststatus=2
set number

" Allow tab expansions (e.g. when opening files)
set wildmenu
set wildmode=longest,list

set expandtab
set shiftwidth=4
set tabstop=4

filetype plugin indent on

:set hlsearch

" Case insensitive search, unless an upper-case
"   character is included in the search string
"   adding \C to the search string also enforces
"   case sensitive search
set smartcase
set ignorecase

" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>