He aquí el código que hay que agregar a .vimrc en nuestro directorio $HOME.
set nocompatibleDe esta manera podremos usar ñ para ir a la izquierda, j para ir a la derecha, k para bajar y l para subir.
noremap ñ l
noremap l k
noremap k j
noremap j h
set nocompatibleDe esta manera podremos usar ñ para ir a la izquierda, j para ir a la derecha, k para bajar y l para subir.
noremap ñ l
noremap l k
noremap k j
noremap j h
syntax on
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
#!/bin/bash
# Name: djvim
# Description: Script to automate the setup of the
# enviroment vars to use omicomplete in vim
# for Django projects.
# Usage: djvim filename
#
# Author: Jesús Manuel Mager Hois
# Copyright: GPL v3 or later
#Set the global vars to the Django project
function startvim(){
local arr=$(echo $1 | tr "/" "\n")
for x in $arr
do
#echo "[$x]"
local PROJECT=$x
done
echo $PROJECT
cd ..
local DIR=`pwd`
export PYTHONPATH=$PYTHONPATH:$DIR
export DJANGO_SETTINGS_MODULE=$PROJECT.settings
vim $ARGS
}
#Iter the directory tree to find setting.py
function finddjbase(){
cd ..
local DIRF=`pwd`
local FILEF=`echo "$DIRF/settings.py"`
if [ $DIRF == '/' ]
then
echo "Couldn't find the Django base directory"
exit
fi
echo "Trying in $DIRF"
if ( ! fileexists $FILEF )
then
finddjbase
else
startvim "$DIRF"
exit
fi
}
#Check if we can find setting.py
function fileexists(){
local f="$1"
if [ ! -f $f ]
then
echo "This is not the Django base directory... trying"
return 1
else
echo "settings.py FOUND at $1"
return 0
fi
}
#Main block
ARGS=$@
DIRN=`pwd`
FILEN=`echo "$DIRN/settings.py"`
if ( ! fileexists $FILEN )
then
finddjbase
else
startvim $DIRN
exit
fi
syntax on
set hls
set expandtab
set textwidth=0
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set backspace=indent,eol,start
set incsearch
set ignorecase
set ruler
set wildmenu
set smarttab
set nu
set mouse=a
filetype indent on
filetype on
filetype plugin on
let g:pydiction_location = '/home/julio/.vim/after/ftplugin/pydiction/pydiction-1.2/complete-dict'
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
map <C-s>:setlocal spell spelllang=es_mx<CR>
map <C-e>:setlocal spell spelllang=en_us<CR>
map <C-q>:setlocal nospell<CR>