Menu

Home

Walter Fabian Rodriguez Salazar

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.

Project Members:


Discussion

  • Walter Fabian Rodriguez Salazar

    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>

     
  • Walter Fabian Rodriguez Salazar

    command! PhpConsole :call PHPConsole()
    
    "Evitar el error cuando accidentalmente uso :W o :Q
    command! -bang -range=% -complete=file -nargs=* W <line1>,<line2>write<bang> <args>
    command! -bang Q quit<bang>
    
    " =================================================================================================
    " =================================================================================================
    " 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>')
    
    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>
    
     
  • Walter Fabian Rodriguez Salazar

    .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>

    " Inhabilitar teclas de cursor, solo moverse con hjkl
    inoremap <Up>    <NOP>
    inoremap <Down>  <NOP>
    inoremap <Left>  <NOP>
    inoremap <Right> <NOP>
    noremap  <Up>    <NOP>
    noremap  <Down>  <NOP>
    noremap  <Left>  <NOP>
    noremap  <Right> <NOP>
    
    " Mover lineas hacia arriba o abajo
    nnoremap <Down> :m+<CR>==
    nnoremap <Up> :m-2<CR>==
    
    " Formato de lineas
    nnoremap <Left> <<
    nnoremap <Right> >>
    vnoremap <Left> <
    vnoremap <Right> >
    

    " }}}

    " 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

    ================================================================================

     
  • Walter Fabian Rodriguez Salazar

    !/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)

    def makePanel(self, titulo):
        """Genera un panel con borde titulo"""
        panel = swing.JPanel(layout=awt.BorderLayout())
        panel.border = swing.border.TitledBorder(swing.border.EtchedBorder(), titulo)
        return panel
    

    if name == 'main':
    swing.UIManager.setLookAndFeel(swing.plaf.nimbus.NimbusLookAndFeel())
    frame = MainFrame()
    frame.visible = True

     

Log in to post a comment.

MongoDB Logo MongoDB