lunedì 15 febbraio 2016

My .vimrc

Note: this is a WIP article: I suggest to bookmark and visit it periodically to get updates.

.vimrc is the configuration file for powerful and extensible code editor Vim.

It cannot be denied: Vim is really overlwhelming in a first approach.

Its structure, shortcuts and general different concept of use from other editors make it really hard to understand for newbies.

But if you put some efforts into learning its commands, you'll be able to code as fast as hell and with much more efficiency than using other software.

One good start is trying to configure its .vimrc file (usually located in ~/.vimrc under *nix machines), day by day, in order to customize your environment and reduce the number of commands you have to insert before starting to code.

After a while you'll set up a complete framework with autocomplete, tabs, buffers, autoindent, custom color theme, syntax highlight and so on.

Here's mine.






execute pathogen#infect()

set nocompatible              " be iMproved, required
filetype off                  " required

" ***************************** INIT Vundle ****************************************** 

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin '907th/vim-auto-save'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

" Put your non-Plugin stuff after this line

" ***************************** END Vundle ******************************************** 


let g:auto_save = 1  " enable AutoSave 
" let g:auto_save_no_updatetime = 1  " do not change the 'updatetime' option
let g:auto_save_in_insert_mode = 0  " do not save while in insert mode

" Paste always the same selected chunk
xnoremap p pgvy

" Open Tagbar automatically
autocmd vimenter * Tagbar

" Open NERDTree automatically
autocmd vimenter * NERDTree

" Start NerdTree on all tabs at startup
let g:nerdtree_tabs_open_on_console_startup=1 

" Height of the command bar
set cmdheight=2

" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l

" Ignore case when searching
set ignorecase

set ts=4 sw=4
syntax on " Syntax highlighting
set showmatch " Shows matching brackets
set ruler " Always shows location in file (line#)
set smarttab " Autotabs for certain code
set shiftwidth=4
set autoindent
set smartindent
" set color scheme
:color desert

" set cursorline
:set cursorline

" set cursorcolumn
:set cursorcolumn

" set row highlight
:hi CursorLine cterm=NONE ctermbg=grey ctermfg=black guibg=grey guifg=white

" set cursor line number highlight 
:hi CursorLineNr cterm=NONE ctermbg=grey ctermfg=black guibg=grey guifg=white

" set column highlight
:hi CursorColumn cterm=NONE ctermbg=darkgrey ctermfg=white guibg=grey guifg=white

" toggle cursor column and line highlight 
:nnoremap H :set cursorline! cursorcolumn!

" Wildmenu
if has("wildmenu")
    set wildignore+=*.a,*.o
    set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png
    set wildignore+=.DS_Store,.git,.hg,.svn
    set wildignore+=*~,*.swp,*.tmp
 set wildignore+=*.sh,*.py,*.txt
    set wildmenu
    set wildmode=longest:list,full
endif

nmap  :TagbarToggle

set number " Show lines number
set numberwidth=3
:highlight LineNr ctermfg=grey
set laststatus=2 " Airline status line
:inoremap ( ()i 
:inoremap [ []i
:inoremap { {}i
:inoremap " ""i
:inoremap ' ''i
noremap  :call HexMe()
set pastetoggle= " Use F2 to toggle paste mode
let $in_hex=0

function HexMe()
set binary
set noeol
if $in_hex>0
:%!xxd -r
let $in_hex=0
else
:%!xxd
let $in_hex=1
endif
endfunction 





lunedì 21 settembre 2015

Hello World!





"Be the code"
(YTR20150921)

Hello World!

AllART Softworks is your new web port.
Hub.
Synapsis.
Node.
Whatever.

We love FOSS (Free and Open Source Software) and develop software and multimedia with and for it.

Hoping it will serve you well.

Relax, stretch your legs, and take a tour.

Thank you for being here.