xolag on Nostr: #Vim Tips: interesting options to add to your .vimrc I hope it will be useful for ...
#Vim Tips:
interesting options to add to your .vimrc
I hope it will be useful for anyone
"Mis Reglas Básicas:
syntax on
filetype on
filetype plugin on
filetype plugin indent on
set number
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set smartindent
set foldmethod=indent
set foldlevel=99
set showcmd
set autochdir
set showmatch
set hidden
set hlsearch
set incsearch
nmap <silent> ,/ :nohlsearch<CR>
set ignorecase
set smartcase
set ruler
set wildmenu
set wildmode=list:full
set wildignore=*.swp,*.bak,*.pyc,*.class
set nobackup
set noswapfile
set noundofile
set spelllang=es,en
set spellsuggest=best
set helplang=es
set encoding=utf-8
set fileencoding=utf-8
"set fileformats="unix,dos,mac"
"set fileformat=unix
set backspace=indent,eol,start
" To save, press ctrl-s.
nmap <c-s> :w<CR>
imap <c-s> <Esc>:w<CR>a
" Is has mouse
if has('mouse')
set mouse=a
endif
"Set general format
if has("gui_running")
set lines=37
set columns=126
"set guioptions-=m
set guioptions-=T
colorscheme desert
else
set background=dark
"colorscheme desert
endif
set lazyredraw
set laststatus=2
set cmdheight=2
set cursorline
" Avoid accidental hits of <F1> while aiming for <Esc>
map! <F1> <Esc>
" Quickly close the current window
nnoremap <leader>q :q<CR>
" Font. Very important.
if has('win32') || has('win64')
set guifont=Consolas:h12:cANSI
elseif has('unix')
set guifont="Monospace 10"
endif
" OTRAS OPCIONES
let mapleader=','
nnoremap ; :
set title
set visualbell
set noerrorbells
" Remap j and k to act as expected when used on long, wrapped, lines
nnoremap j gj
nnoremap k gk
" Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
nnoremap <leader>w <C-w>v<C-w>l
" Yank/paste to the OS clipboard with ,y and ,p
nmap <leader>y "*y
nmap <leader>Y "*yy
nmap <leader>p "*p
nmap <leader>P "*P
" Quick alignment of text
nmap <leader>al :left<CR>
nmap <leader>ar :right<CR>
nmap <leader>ac :center<CR>
" Nerdtree File explorer plugin
map <C-t> :NERDTreeToggle<CR>:NERDTreeMirror<CR>
map <leader>e :NERDTreeFind<CR>
nmap <leader>nt :NERDTreeFind<CR>
let NERDTreeShowBookmarks=1
let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr']
let NERDTreeChDirMode=0
let NERDTreeQuitOnOpen=1
let NERDTreeShowHidden=1
let NERDTreeKeepTreeInNewTab=1
interesting options to add to your .vimrc
I hope it will be useful for anyone
"Mis Reglas Básicas:
syntax on
filetype on
filetype plugin on
filetype plugin indent on
set number
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set smartindent
set foldmethod=indent
set foldlevel=99
set showcmd
set autochdir
set showmatch
set hidden
set hlsearch
set incsearch
nmap <silent> ,/ :nohlsearch<CR>
set ignorecase
set smartcase
set ruler
set wildmenu
set wildmode=list:full
set wildignore=*.swp,*.bak,*.pyc,*.class
set nobackup
set noswapfile
set noundofile
set spelllang=es,en
set spellsuggest=best
set helplang=es
set encoding=utf-8
set fileencoding=utf-8
"set fileformats="unix,dos,mac"
"set fileformat=unix
set backspace=indent,eol,start
" To save, press ctrl-s.
nmap <c-s> :w<CR>
imap <c-s> <Esc>:w<CR>a
" Is has mouse
if has('mouse')
set mouse=a
endif
"Set general format
if has("gui_running")
set lines=37
set columns=126
"set guioptions-=m
set guioptions-=T
colorscheme desert
else
set background=dark
"colorscheme desert
endif
set lazyredraw
set laststatus=2
set cmdheight=2
set cursorline
" Avoid accidental hits of <F1> while aiming for <Esc>
map! <F1> <Esc>
" Quickly close the current window
nnoremap <leader>q :q<CR>
" Font. Very important.
if has('win32') || has('win64')
set guifont=Consolas:h12:cANSI
elseif has('unix')
set guifont="Monospace 10"
endif
" OTRAS OPCIONES
let mapleader=','
nnoremap ; :
set title
set visualbell
set noerrorbells
" Remap j and k to act as expected when used on long, wrapped, lines
nnoremap j gj
nnoremap k gk
" Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
nnoremap <leader>w <C-w>v<C-w>l
" Yank/paste to the OS clipboard with ,y and ,p
nmap <leader>y "*y
nmap <leader>Y "*yy
nmap <leader>p "*p
nmap <leader>P "*P
" Quick alignment of text
nmap <leader>al :left<CR>
nmap <leader>ar :right<CR>
nmap <leader>ac :center<CR>
" Nerdtree File explorer plugin
map <C-t> :NERDTreeToggle<CR>:NERDTreeMirror<CR>
map <leader>e :NERDTreeFind<CR>
nmap <leader>nt :NERDTreeFind<CR>
let NERDTreeShowBookmarks=1
let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr']
let NERDTreeChDirMode=0
let NERDTreeQuitOnOpen=1
let NERDTreeShowHidden=1
let NERDTreeKeepTreeInNewTab=1