WFRS Vim Distribution Wiki
Brought to you by:
walterud
Welcome to your wiki!
This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
The wiki uses Markdown syntax.
title
" =================================================================================================
" =================================================================================================
" Delete buffer while keeping window layout (don't close buffer's windows).
" " Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
let loaded_bclose = 1
if !exists('bclose_multiple')
let bclose_multiple = 1
endif
" Display an error message. function! s:Warn(msg) echohl ErrorMsg echomsg a:msg echohl NONE endfunction
" Command ':Bclose' executes ':bd' to delete buffer in current window.
" The window will show the alternate buffer (Ctrl-^) if it exists,
" or the previous buffer (:bp), or a blank buffer if no previous.
" Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
" An optional argument can specify which buffer to close (name or number).
function! s:Bclose(bang, buffer)
if empty(a:buffer)
let btarget = bufnr('%')
elseif a:buffer =~ '^\d+$'
let btarget = bufnr(str2nr(a:buffer))
else
let btarget = bufnr(a:buffer)
endif
if btarget < 0
call s:Warn('No matching buffer for '.a:buffer)
return
endif
if empty(a:bang) && getbufvar(btarget, '&modified')
call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
return
endif
" Numbers of windows that view target buffer which we will delete.
let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
if !g:bclose_multiple && len(wnums) > 1
call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")')
return
endif
let wcurrent = winnr()
for w in wnums
execute w.'wincmd w'
let prevbuf = bufnr('#')
if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
buffer #
else
bprevious
endif
if btarget == bufnr('%')
" Numbers of listed buffers which are not the target to be deleted.
let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
" Listed, not target, and not displayed.
let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
" Take the first buffer, if any (could be more intelligent).
let bjump = (bhidden + blisted + [-1])[0]
if bjump > 0
execute 'buffer '.bjump
else
execute 'enew'.a:bang
endif
endif
endfor
execute 'bdelete'.a:bang.' '.btarget
execute wcurrent.'wincmd w'
endfunction
command! -bang -complete=buffer -nargs=? Bclose call s:Bclose('<bang>', '<args>')</args></bang>
nnoremap <silent> ,bd :Bclose<cr>
" =================================================================================================
" =================================================================================================
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
noremap <up> <nop>
noremap <down> <nop>
noremap <left> <nop>
noremap <right> <nop></nop></right></nop></left></nop></down></nop></up></nop></right></nop></left></nop></down></nop></up></cr></silent>
.vim
├── bundle
│ └── ....
├── colors
│ ├── gzenburn.vim
│ └── zenburn.vim
├── resources
│ ├── scripts
│ │ ├── bufferClose.vim
│ │ ├── functions.vim
│ │ └── vimProject.vim
│ └── snippets
│ └── ....
├── settings
│ ├── airline.vim
│ └── emmet.vim
└── spell
└── es.utf-8.spl
================================================================================
.VIMRC
" Inicio Vundle {{{
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
"source ~/.vim/bundles.vim
" }}}
" Caracteristicas generales {{{
filetype plugin indent on
syntax on
set backspace=indent,eol,start
set noautoindent
set t_Co=256
set term=screen-256color
set t_ut=
set background=dark
let g:zenburn_transparent = 1
colorscheme zenburn
" }}}
" Configuarcion de variables {{{
set autowrite
set autowriteall
set encoding=UTF-8
set expandtab
set ff=unix
set fileencoding=UTF-8
set foldmethod=marker
set ignorecase
set hlsearch
set laststatus=2
set nobackup
set nowrap
set number
set numberwidth=5
set ruler
set shiftwidth=4
set tabstop=4
set showmatch
set incsearch
set expandtab
set smarttab
set autoindent
set smartindent
set wildmode=longest,list:longest
set noshowmode
set textwidth=110
" }}}
" Comandos y mapeos Generales {{{
" Cuando accidentalmente uso :W o :Q realice los comandos :w o :q
command! -bang -range=% -complete=file -nargs=* W <line1>,<line2>write<bang> <args>
command! -bang Q quit<bang></bang></args></bang></line2></line1>
" }}}
" funciones de utilidad
source ~/.vim/resources/scripts/functions.vim
" Bundles(plugins) basicos a cargar
call LoadSettings('airline')
call LoadScript('vimProject')
================================================================================
BUFFERCLOSE.VIM
" Delete buffer while keeping window layout (don't close buffer's windows).
" " Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
let loaded_bclose = 1
if !exists('bclose_multiple')
let bclose_multiple = 1
endif
" Display an error message. function! s:Warn(msg) echohl ErrorMsg echomsg a:msg echohl NONE endfunction
" Command ':Bclose' executes ':bd' to delete buffer in current window.
" The window will show the alternate buffer (Ctrl-^) if it exists,
" or the previous buffer (:bp), or a blank buffer if no previous.
" Command ':Bclose!' is the same, but executes ':bd!' (discard changes).
" An optional argument can specify which buffer to close (name or number).
function! s:Bclose(bang, buffer)
if empty(a:buffer)
let btarget = bufnr('%')
elseif a:buffer =~ '^\d+$'
let btarget = bufnr(str2nr(a:buffer))
else
let btarget = bufnr(a:buffer)
endif
if btarget < 0
call s:Warn('No matching buffer for '.a:buffer)
return
endif
if empty(a:bang) && getbufvar(btarget, '&modified')
call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)')
return
endif
" Numbers of windows that view target buffer which we will delete.
let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget')
if !g:bclose_multiple && len(wnums) > 1
call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")')
return
endif
let wcurrent = winnr()
for w in wnums
execute w.'wincmd w'
let prevbuf = bufnr('#')
if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w
buffer #
else
bprevious
endif
if btarget == bufnr('%')
" Numbers of listed buffers which are not the target to be deleted.
let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget')
" Listed, not target, and not displayed.
let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0')
" Take the first buffer, if any (could be more intelligent).
let bjump = (bhidden + blisted + [-1])[0]
if bjump > 0
execute 'buffer '.bjump
else
execute 'enew'.a:bang
endif
endif
endfor
execute 'bdelete'.a:bang.' '.btarget
execute wcurrent.'wincmd w'
endfunction
command! -bang -complete=buffer -nargs=? Bclose call s:Bclose('<bang>', '<args>')</args></bang>
nnoremap <silent> ,bd :Bclose<cr></cr></silent>
================================================================================
FUNCTIONS.VIM
" Carga un archivo de configuracion de la carpeta settings
function! LoadSettings(script)
execute 'source ~/.vim/settings/' . a:script . '.vim'
endfunction
" Carga un archivo de script de la carpeta resources/scripts
function! LoadScript(script)
execute 'source ~/.vim/resources/scripts/' . a:script . '.vim'
endfunction
================================================================================
VIMPROJECT.VIM
"Cargar archivo de configurcion local para cada proyecto
if filereadable('.vimproject')
source .vimproject
endif
================================================================================
!/usr/bin/env jython
-- coding: utf-8 --
from javax import swing
from java import awt
class MainFrame(swing.JFrame):
"""Ventana principal"""
def init(self):
super(MainFrame, self).init('Kanban',
defaultCloseOperation = swing.JFrame.EXIT_ON_CLOSE,
size = (300, 300))
self.layout = awt.BorderLayout()
panelT = swing.JPanel()
panelT.layout = awt.GridLayout(1,4)
panelT.add(self.makePanel('Nuevo'))
panelT.add(self.makePanel(u'Ejecución'))
panelT.add(self.makePanel('Pendiente'))
panelT.add(self.makePanel('Terminado'))
self.add(panelT, awt.BorderLayout.CENTER)
if name == 'main':
swing.UIManager.setLookAndFeel(swing.plaf.nimbus.NimbusLookAndFeel())
frame = MainFrame()
frame.visible = True