elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


+  Foro de elhacker.net
|-+  Sistemas Operativos
| |-+  GNU/Linux (Moderador: MinusFour)
| | |-+  Postea tu .bashrc/alias/scripts/.vimrc
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 2 3 [4] Ir Abajo Respuesta Imprimir
Autor Tema: Postea tu .bashrc/alias/scripts/.vimrc  (Leído 57,680 veces)
Dark Side

Desconectado Desconectado

Mensajes: 41



Ver Perfil
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #30 en: 16 Febrero 2013, 00:22 am »

Pues actualmente tengo configurado lo siguiente:

.bash_aliases
Código
  1.  alias cd..='cd ..'
  2.  alias la='ls -la'
  3.  alias ll='ls -l'
  4.  alias pingg='ping google.com'
  5.  alias update='sudo apt-get update'
  6.  alias upgrade='sudo apt-get upgrade'
  7.  alias aptinsall='sudo apt-get install'
  8.  alias aptsearch='sudo apt-cache search'
  9.  alias :q='exit'

.bashrc
Código
  1. # User settings
  2. screenfetch-dev
  3. #PS1='\[\e[0;34m\][\W]\[\e[m\] ' Prompt en formato [dirActual]
  4. #PS1='[\u@\h \W]\$ ' Prompt en formato [usr@host dirActual]
  5. PS1='\n\e[0;37m\]┌─\e[1;34m\][\u@\h] - \e[0;37m\][\D{%d/%m/%y} - \t]\e[1;34m\] - [\w]\n\e[0;37m\]└─> \e[1;34m\]\$ \e[0;0m\]'

El prompt queda de la siguiente forma:

┌─[user@host] - [dd/mm/yy - HH:mm:ss] - [~]
└─> $

Y el .vimrc
Código:
  1 set number
  2 set wrap
  3 set incsearch
  4 set hlsearch
  5 set expandtab
  6 set autoindent
  7 set wildmenu
  8 set textwidth=80
  9 set tabstop=8
 10
 11 "Activar uso del mouse
 12         set mouse=a
 13
 14 "Tecla para mostrar/ocultar NERDTree
 15         map <F2> :NERDTreeToggle<cr>
 16
 17 "Tema
 18         colorscheme desert
 19
 20 "Movimiento entre ventanas
 21         map <C-J> <C-W>j<C-W>_
 22         map <C-K> <C-W>k<C-W>_
 23         map <C-L> <C-W>l<C-W>_
 24         map <C-H> <C-W>h<C-W>_
 25
 26 "Movimiento entre pestañas
 27         map <S-H> gT
 28         map <S-L> gt

SalU2!
Dark Side


En línea

v4clox

Desconectado Desconectado

Mensajes: 2


Ver Perfil
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #31 en: 28 Febrero 2013, 22:14 pm »

Uso bastante la shell pero nunca me habia parado a configurarla, soy un mal linuxero...


En línea

Ser libre no es elegir a tu jefe.
Algabe

Desconectado Desconectado

Mensajes: 3



Ver Perfil
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #32 en: 9 Abril 2013, 18:02 pm »

Código
  1. #
  2. # ~/.bashrc
  3. #
  4.  
  5. # If not running interactively, don't do anything
  6. [[ $- != *i* ]] && return
  7. export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  8. alias ls='ls --color=auto'
  9.  
  10. export LANG=en_US.UTF-8
  11. export EDITOR="nano"
  12. export synclient VertEdgeScroll=1
  13.  
  14. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  15. HISTSIZE=1500
  16. HISTFILESIZE=3000
  17.  
  18. # don't put duplicate lines in the history. See bash(1) for more options
  19. # ... or force ignoredups
  20. HISTCONTROL=ignoredups
  21. HISTIGNORE=":htop*:ls*:su*:history*:pacman*:exit*"
  22.  
  23. #PS1='[\u@\h \W]\$ '
  24. #PS1='\[\033[0;41m\] \u@\h\[\033[01;36m\]\W \$ \[\033[00m\] '
  25. #PS1='\[\e[1;32m\][\u\[\e[m\]@\[\e[1;33m\]\h\[\e[1;34m\] \w]\[\e[1;36m\] \$\[\e[1;37m\] '
  26. #PS1='&#38;#9484;&#38;#9472;&#38;#9472;[\u@\h][\w][\t]\n&#38;#9492;&#38;#9472;&#38;#9472;[\$] '
  27. #PS1='&#38;#9484;&#38;#9472;[\u][\A][\w]\n&#38;#9492;&#38;#9472;[\$] '
  28. PS1='\[\e[1;34m\]&#38;#9484;&#38;#9472; \e[1;32m\u\e[m@\e[1;33m\h\e[1;34m [\e[m\t\e[1;34m] [\e[m\w\e[1;34m] \n &#38;#9492;&#38;#9472; $ \[\e[m\]'
  29. #PS1='\[\033[1;32m\]\u@\h\[\033[1;36m\] \W \$\[\033[00m\] '
  30.  
  31. # Alias definitions.
  32. # You may want to put all your additions into a separate file like
  33. # ~/.bash_aliases, instead of adding them here directly.
  34. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  35. if [ -f ~/.bash_aliases ]; then
  36.    . ~/.bash_aliases
  37. fi
  38.  
  39. # enable color support of ls and also add handy aliases
  40. if [ -x /usr/bin/dircolors ]; then
  41.    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  42.    alias ls='ls -lh --color=auto'
  43.    alias ll='ls -lh --color=auto'
  44.    alias dir='ls -lh --color=auto'
  45.    alias grep='grep --color=auto'
  46.    alias fgrep='fgrep --color=auto'
  47.    alias egrep='egrep --color=auto'
  48. fi
  49.  
  50. setxkbmap -layout "latam" -option "grp:alt_shift_toggle"
  51. set completion-ignore-case on
  52. #siv -t -c4
  53. alsi -a -u c1=blue c2=blue
En línea

J414NP3R

Desconectado Desconectado

Mensajes: 6


Ver Perfil
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #33 en: 15 Abril 2013, 22:34 pm »


Me gustaría aumentar el margen en la terminal de gnome, debido a que por defecto no tiene márgenes.

A lo que me refiero es a aumentar el espacio entre el borde de la ventana y el texto de entrada/salida de la consola.

Por ejemplo:

Código:
=[X][-][ ]=============Mi Terminal==================
|                                                  |
|  $> echo "Hay margen arriba, a la izquierda y a  |
|  la derecha."                                    |
|                                                  |
|                                                  |
|                                                  |
====================================================

Si alguien tiene idea de como hacer esto le agradezco su ayuda.

Un saludo.
En línea

lawish

Desconectado Desconectado

Mensajes: 29



Ver Perfil
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #34 en: 4 Diciembre 2013, 19:46 pm »

# .bashrc

# User specific aliases and functions

Ose nada de nada
En línea

GML group
Slacker
danny920825

Desconectado Desconectado

Mensajes: 175


Ver Perfil WWW
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #35 en: 8 Junio 2015, 22:30 pm »

Hola a todos, aqui traigo un script que me gustaria que revisaran y obvio que acepto sugerencias en cuanto al codigo. El objetivo es que haga una salva de las trazas del squid (access.log) en una carpeta llamada salvas ubicada en la raiz. Si puede ser mejorado, no se lo callen por favor.

Código:
#!/bin/bash
#INFORMACION DEL SCRIPT:
#ESTE SCRIPT SIRVE PARA HACER UNA SALVA DEL ACCESS.LOG DEL SQUID.

#VARIABLES
DIA=`date +%d`
MES=`date +%m`
YEAR=`date +%y`
HORA=`date +%H%M`
ARCHIVO=trazas-$DIA$MES$YEAR$HORA.log




#DETENER SQUID
service squid stop
echo "Squid detenido esperando 2 segundos para continuar"

#ESPERAMOS POR SI ACASO
sleep 2s

#MOVER EL ARCVHIVO DE LOS LOG's
echo "Moviendo el archivo de las trazas para /salvas/"
mv /var/log/squid/access.log /salvas/$ARCHIVO
echo "listo"


#CREACION DEL ARCHIVO NUEVO
echo "Creando el nuevo archivo en blanco"
touch /var/log/squid/access.log
echo "Listo"

#PERMISO DE ESCRITURA AL NUEVO ARCHIVO
echo "Asigando permisos al nuevo archivo"
chmod 777 /var/log/squid/access.log
echo "listo"

#INICIAMOS EL SQUID
echo "Iniciando el squid"
service squid start
echo "Listo, copia realizada con exito"

#ESPERAMOS POR SI ACASO
sleep 5s

#SALIMOS
exit 0
En línea

"Los que reniegan de Dios es por desesperación de no encontrarlo".
   Miguel de Unamuno
estudianteaprendiendo

Desconectado Desconectado

Mensajes: 6


Ver Perfil
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #36 en: 1 Julio 2015, 21:30 pm »

muy interesante realmente estoy empezando a usar kali linux bueno no soy programador ni nada estoy estudiando otra cosa nada relacionado con informática pero encuentro interesante todo esto tengo un problema con eso de que no se reconoce un comando eso de la modificacion .bashrc podria aydarme ?

#msfpayload -h
bash: msfpayload : no se encontro la orden

es lo que me aparece espero puedan orientar mese que esto ya lo e colocado en un tema pero al leer un poco de tu proyecto me resulta interesante saber si puede solucionar mi problema  y si no igualmente gracias
En línea

dac

Desconectado Desconectado

Mensajes: 94



Ver Perfil WWW
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #37 en: 19 Agosto 2015, 21:40 pm »

.zshrc
Código:
#{{{ ZSH Modules
    autoload -U compinit promptinit zcalc zsh-mime-setup
    autoload -U colors && colors
    autoload -Uz vcs_info
    compinit
    promptinit
    zsh-mime-setup
#}}}

#{{{ Options
    # See `man zshoptions`

    setopt CORRECT
    setopt GLOB_COMPLETE
    setopt RM_STAR_WAIT
    setopt ZLE
    setopt VI
    setopt NO_HUP
    setopt IGNORE_EOF
    setopt NO_BEEP
    setopt NUMERIC_GLOB_SORT
    setopt EXTENDED_GLOB
    setopt RC_EXPAND_PARAM
    setopt APPEND_HISTORY
    setopt  COMPLETE_IN_WORD
    setopt prompt_subst
    setopt nohashdirs
    setopt nohashcmds
    unsetopt FLOW_CONTROL
    unsetopt LIST_AMBIGUOUS

    # History options
    setopt EXTENDED_HISTORY
    setopt SHARE_HISTORY
    setopt HIST_IGNORE_DUPS
    setopt HIST_IGNORE_ALL_DUPS
    setopt HIST_REDUCE_BLANKS
    setopt HIST_IGNORE_SPACE
    setopt HIST_NO_STORE
    setopt HIST_VERIFY
    setopt HIST_SAVE_NO_DUPS
    setopt HIST_EXPIRE_DUPS_FIRST
    setopt HIST_FIND_NO_DUPS
#}}}

#{{{ Variables
    export EDITOR=vim
    export PAGER=less
    export JAVA_HOME="/usr"
    export _JAVA_AWT_WM_NONREPARENTING=1
    export KEYTIMEOUT=1  # Reduce vi-mode lag
    export ANDROID_HOME="/opt/android-sdk"
    export ANDROID_SWT="/usr/share/java"
    export ANDROID_TOOLS="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
    export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$ANDROID_TOOLS"
    declare -U path

    # History
    HISTFILE=~/.history
    SAVEHIST=1000
    HISTSIZE=1000
#}}}

#{{{ Aliases
    alias x='startx'
    alias p='ping 8.8.8.8'
    alias ls='ls --color'
    alias vi='/usr/bin/vim'
    alias vim='nvim'
    alias emacs='emacs -nw'
    alias am='alsamixer' alsamixer='alsamixer -g -c 0'
#}}}

#{{{ Completion
    # See `man zshcompsys

    zstyle ':completion::complete:*' use-cache 1
    zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
    zstyle ':completion:*' verbose yes
    zstyle ':completion:*:descriptions' format '%B%d%b'
    zstyle ':completion:*:messages' format '%d'
    zstyle ':completion:*' group-name ''
    zstyle ':completion:*' auto-description 'specify: %d'
    zstyle ':completion:*:default' list-prompt '%S%M matches%s'
    zstyle ':completion:*:default' menu 'select=0'
    zstyle ':completion:*' file-sort modification reverse
    zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
    zstyle ':completion:*:manuals' separate-sections true
    zstyle ':completion:*:corrections' format '%B%d (errors %e)%b'
    zstyle ':completion::*:(rm|vi):*' ignore-line true
    zstyle ':completion:*' ignore-parents parent pwd
    zstyle ':completion::approximate*:*' prefix-needed false
#}}}

#{{{ Key bindings
    # Special keys works properly

    bindkey '\e[1~' beginning-of-line
    bindkey '\e[4~' end-of-line
    bindkey '\e[A' up-line-or-history
    bindkey '\e[B' down-line-or-history
    bindkey '\eOA' up-line-or-history
    bindkey '\eOB' down-line-or-history
    bindkey '\e[C' forward-char
    bindkey '\e[D' backward-char
    bindkey '\eOC' forward-char
    bindkey '\eOD' backward-char
#}}}

#{{{ Prompt
    zstyle ':vcs_info:*' stagedstr '%F{28}^'
    zstyle ':vcs_info:*' unstagedstr '%F{11}^'
    zstyle ':vcs_info:*' check-for-changes true
    zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
    zstyle ':vcs_info:*' enable git svn

    precmd()
    {
        if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
            zstyle ':vcs_info:*' formats ' [%F{green}%b%c%u%F{normal}]'
        } else {
            zstyle ':vcs_info:*' formats ' [%F{green}%b%c%u%F{red}^%F{normal}]'
        }

        vcs_info
    }

    PROMPT='%{$fg[blue]%}%B%n%b%{$reset_color%}@%{$fg[magenta]%}%B%M%b%{$reset_color%} %1~ ${vcs_info_msg_0_}%{$reset_color%}%# '
#}}}

#{{{ Vi-mode
    # From `oh-my-zsh` vi-mode plugin

    # Ensures that $terminfo values are valid and updates editor information when
    # the keymap changes.
    function zle-keymap-select zle-line-init zle-line-finish {
      # The terminal must be in application mode when ZLE is active for $terminfo
      # values to be valid.
      if (( ${+terminfo[smkx]} )); then
        printf '%s' ${terminfo[smkx]}
      fi
      if (( ${+terminfo[rmkx]} )); then
        printf '%s' ${terminfo[rmkx]}
      fi

      zle reset-prompt
      zle -R
    }

    # Ensure that the prompt is redrawn when the terminal size changes.
    TRAPWINCH() {
      if [[ -o zle ]]; then
        zle reset-prompt
        zle -R
      fi
    }

    zle -N zle-line-init
    zle -N zle-line-finish
    zle -N zle-keymap-select
    zle -N edit-command-line


    bindkey -v

    # Avoid dropping keystrokes after ESC hit
    bindkey -as '\e' ''

    # allow v to edit the command line
    # autoload -Uz edit-command-line
    # bindkey -M vicmd 'v' edit-command-line

    # allow ctrl-p, ctrl-n, ctrl-r for navigate history (standard behaviour)
    bindkey '^P' up-history
    bindkey '^N' down-history
    bindkey '^r' history-incremental-search-backward

    # Incrementar search for / and ?
    bindkey -M vicmd "/" history-incremental-search-backward
    bindkey -M vicmd "?" history-incremental-search-forward

    # allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
    bindkey '^?' backward-delete-char
    bindkey '^h' backward-delete-char
    bindkey '^w' backward-kill-word

    # Some extra vim like bindings
    bindkey -a 'gg' beginning-of-buffer-or-history
    bindkey -a 'G' end-of-buffer-or-history
    bindkey -a 'u' undo
    bindkey -a '^R' redo

    # Mode indicator right prompt
    function zle-line-init zle-keymap-select
    {
        RPS1="${${KEYMAP/vicmd/}/(main|viins)/-- INSERT --}"
        RPS2=$RPS1
        zle reset-prompt
    }

    # Allow Copy/Paste with the system clipboard
    # behave as expected with vim commands ( y/p/d/c/s )
    [[ -n $DISPLAY ]] && (( $+commands[xclip] )) && {

      function cutbuffer() {
        zle .$WIDGET
        echo $CUTBUFFER | xclip -selection clipboard
      }

      zle_cut_widgets=(
        vi-backward-delete-char
        vi-change
        vi-change-eol
        vi-change-whole-line
        vi-delete
        vi-delete-char
        vi-kill-eol
        vi-substitute
        vi-yank
        vi-yank-eol
      )
      for widget in $zle_cut_widgets
      do
        zle -N $widget cutbuffer
      done

      function putbuffer() {
        zle copy-region-as-kill "$(xclip -selection clipboard -o)"
        zle .$WIDGET
      }

      zle_put_widgets=(
        vi-put-after
        vi-put-before
      )
      for widget in $zle_put_widgets
      do
        zle -N $widget putbuffer
      done
    }
#}}}

#{{{ Misc
    # Deactivate Software flow control
    stty -ixon

    # Set proper terminal for SCREEN and TMUX
    if [[ -z $TMUX ]]; then
        if [ -e /usr/share/terminfo/x/xterm+256color ]; then
            export TERM='xterm-256color'
        else
            export TERM='xterm'
        fi
    else
        if [ -e /usr/share/terminfo/s/screen-256color ]; then
            # export TERM='screen-256color'
            export TERM='xterm-256color'
        else
            export TERM='screen'
        fi
    fi

    # Autorun TMUX (Only when X11 is running)
    # if [[ (-e /tmp/.X0-lock) ]]; then
    #     if [[ -n $TMUX ]]; then
    #         # Tmux running, do nothing
    #     else
    #         tmux -2
    #     fi
    # fi
#}}}

#{{{ First Init
    # Auto start X11 and Wifi connection
    if [[ ! (-e /tmp/.X0-lock) ]]; then
        # ~/.wifi.sh
        ./.ether.sh
        startx
    fi
#}}}


# vim:fdm=marker



.nvimrc
Código:
"{{{ VIM-PLUG
    call plug#begin('~/.vim/plugged')
    Plug 'wellle/targets.vim'
    Plug 'tpope/vim-commentary'
    Plug 'tpope/vim-surround'
    Plug 'tpope/vim-fugitive'
    Plug 'tpope/vim-unimpaired'
    Plug 'tpope/vim-repeat'
    Plug 'michaeljsmith/vim-indent-object'
    Plug 'scrooloose/syntastic'
    Plug 'scrooloose/nerdtree'
    Plug 'vim-scripts/taglist.vim'
    Plug 'kien/ctrlp.vim'
    Plug 'thanthese/Tortoise-Typing'
    Plug 'mbbill/undotree'
    Plug 'alx741/vinfo'
    Plug 'godlygeek/tabular'
    Plug 'bruno-/vim-man'
    Plug 'altercation/vim-colors-solarized'
    Plug 'junegunn/goyo.vim'
    Plug 'jceb/vim-orgmode'
    Plug 'EinfachToll/DidYouMean'
    Plug 'tommcdo/vim-exchange'
    Plug 'vitalk/vim-simple-todo'
    Plug 'powerman/vim-plugin-viewdoc'

    " On-demand loading
    Plug 'scrooloose/syntastic', { 'on': 'SyntasticCheck' }
    Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
    Plug 'vim-scripts/taglist.vim', { 'on': 'TlistToggle' }
    Plug 'thanthese/Tortoise-Typing', { 'on': 'TortoiseTyping' }
    Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
    Plug 'alx741/vinfo', { 'on': 'Vinfo' }
    Plug 'godlygeek/tabular', { 'on': 'Tabularize' }
    Plug 'bruno-/vim-man', { 'on': 'Man' }
    Plug 'junegunn/goyo.vim', { 'on': 'Goyo' }
    call plug#end()
"}}}


"{{{ Auto Commands
    " Reset format options when filetypes are loaded
    autocmd FileType * set formatoptions=tcrql

    " Trigger StyleMarks
    autocmd VimEnter,BufWinEnter,BufWinLeave * call StyleMarks()
"}}}


"{{{ Maps
    " Get raid of vim 'exclusivity' madness
    " All movements are now inclusive
    " onoremap h vh
    " onoremap l vl
    " onoremap b vb
    " onoremap B vB
    " onoremap F vF
    " onoremap T vT
    " onoremap ^ v^
    " onoremap g^ vg^
    " onoremap + v+
    " onoremap g+ vg+
    " onoremap ( v(
    " onoremap ` v`

    " Move with visual lines
    nnoremap j gj
    nnoremap k gk
    nnoremap J gJ
    nnoremap 0 g0
    nnoremap ^ g^
    nnoremap $ g$

    " Search for visual selected area
    vnoremap // y/<C-R>"<CR>

    " Terminal mode leaving
    tnoremap <esc> <C-\><C-n>

    " Toggle folds
    nnoremap <space> za

    " Remove highlights using escape (this prevent using especial keys mappings!)
    nnoremap <silent><esc> :noh<CR><esc>

    """"  LEADER mappings
    " Remove trailing white spaces ( \w )
    map <silent><leader>f :call Format() <CR>
    " Toggle spelling ( \s )
    nnoremap <leader>s :call ToggleSpell() <cr>
    " Trigger TagList plugin ( \t )
    nnoremap <leader>t :TlistToggle <cr>
    " Trigger UndoTree plugin ( \u )
    nnoremap <leader>u :UndotreeToggle <cr>
    " Trigger NerdTree plugin ( \n )
    nnoremap <leader>n :NERDTreeToggle <cr>
    " Trigger Ctags program for the current directory
    nnoremap <silent><leader>c :!ctags -R . <cr>
"}}}


"{{{ Options and Configurations
    " Status line
    set statusline=[%n]\ %t\ [%{strlen(&fenc)?&fenc:'none'},\ %{&ff}]
    set statusline+=\ [ft=%Y]\ %r\ %m
    set statusline+=%=%c:%l/%L\ %P

    " Color scheme
    colors solarized

    " Set various options
    syntax on
    syntax spell toplevel
    set t_CO=16
    set lazyredraw
    set textwidth=80
    set linebreak
    set timeoutlen=1000 ttimeoutlen=0
    " set cursorline
    set tabstop=4
    set softtabstop=4
    set shiftwidth=4
    set expandtab
    set smarttab
    set showcmd
    set completeopt-=preview
    set completeopt+=longest
    set number
    set showmatch
    set hlsearch
    set incsearch
    set ignorecase
    set smartcase
    set backspace=2
    set autoindent
    set cindent
    set ruler
    set autoread
    set nojoinspaces
    set background=light
    set wrapscan
    set laststatus=2
    set wildmenu
    set wildmode=longest,list,full
    set wildignore=*.o,*.class
    set hidden
    set foldenable
    set foldmethod=syntax
    set foldnestmax=2
    set foldlevel=3
    let c_no_comment_fold=1

    " Formatting options:
    "  * Auto wrap text using textwidth
    "  * Auto wrap comments using textwidth
    "  * Auto insert comment leader while inserting
    "  * Auto formatting of paragraphs
    "  * Don't auto brake lines
    set formatoptions=tcrql

    " Config the backup system
    set backup
    set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
    set backupskip=/tmp/*,/private/tmp/*
    set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
    set writebackup
"}}}


"{{{ Plugins configuration
    " Syntastic
    let $PYTHONPATH='/usr/lib/python3.4/site-packages'
    let g:syntastic_mode_map = {
        \ 'mode' : 'passive',
        \ 'active_filetypes' : [],
        \ 'passive_filetypes' : [] }

    " Targets
    " let g:targets_aiAI = 'aIAi'
"}}}


"{{{ Misc
    " Set SDCC paths
    set path+=/usr/share/sdcc/include/pic14,/usr/share/sdcc/include/pic16
    set path+=/usr/share/sdcc/non-free/include/pic14,/usr/share/sdcc/non-free/include/pic16

    " Sudo Write
    command W w !sudo tee % >/dev/null
"}}}


"{{{ Personal functions

    " Help files tags jump
    " [g , ]g
    nmap [g <Plug>unimpairedHelpTagPrevious
    nmap ]g <Plug>unimpairedHelpTagNext

    nnoremap <silent> <Plug>unimpairedHelpTagPrevious :call <SID>HelpTag(1)<CR>
    nnoremap <silent> <Plug>unimpairedHelpTagNext     :call <SID>HelpTag(0)<CR>

    function! s:HelpTag(reverse)
      call search('|\S\+|', a:reverse ? 'bW' : 'W')
    endfunction


    " Format document
    "
    " * Removes trailing white spaces
    " * Removes blank lines at the end of the file
    " * Replaces tabs with spaces
    " * Re-Indent
    "
    " * If: C, CPP, PHP or JAVA code: format using 'astyle'
    "       * Style: allman
    "       * Braces in the first column
    "       * Spaces between operators
    "
    " * Leaves 'formatprg' option clean so `gq` can be used with the default
    "   behavior
    function! Format()
        silent! execute 'norm! mz'

        if &ft ==? 'c' || &ft ==? 'cpp' || &ft ==? 'php'
            set formatprg=astyle\ --mode=c\ --style=allman\ -j\ -p\ -f\ -xe\ -xC80\ -H
            silent! execute 'norm! gggqG'
        elseif &ft ==? 'java'
            set formatprg=astyle\ --mode=java\ --style=allman\ -j\ -p\ -f\ -xe\ -xC80\ -H
            silent! execute 'norm! gggqG'
        endif

        silent! execute '%s/\s\+$//ge'
        silent! execute 'g/\v^$\n*%$/norm! dd'
        silent! execute 'retab'
        silent! execute 'gg=G'
        silent! execute 'norm! `z'
        set formatprg=
    endfunction


    " Alternate between { NOSPELL, EN, ES } spelling
    function! ToggleSpell()
        if &spell ==? 0
            set spelllang=en
            set spell
            echom "Spell [EN]"

        elseif &spell ==? 1
            if &spelllang ==? 'en'
                set spelllang=es
                echom "Spell [ES]"

            elseif &spelllang ==? 'es'
                set spelllang=en
                set nospell
                echom "NO Spell"
            endif
        endif
    endfunction


    " Marks over length lines and trailing white spaces as errors
    function! StyleMarks()
        highlight OverLength ctermbg=blue ctermfg=white
        call matchadd('OverLength', '\%81v.\+', 100)

        highlight Trailing ctermbg=blue ctermfg=white
        call matchadd('Trailing', '\s\+$', 100)

        highlight Debugme ctermbg=red ctermfg=white
        call matchadd('Debugme', 'debugme', 100)
        call matchadd('Debugme', 'DEBUGME', 100)
    endfunction
"}}}

" vim:fdm=marker



.tmux.conf
Código:
# Set the current working directory based on the current pane's current
# working directory (if set; if not, use the pane's starting directory)
# when creating # new windows and splits.
bind-key c new-window -c '#{pane_current_path}'
bind-key '"' split-window -c '#{pane_current_path}'
bind-key % split-window -h -c '#{pane_current_path}'

# use UTF8
set -g utf8
set-window-option -g utf8 on

# Index start from 1 (insted of 0)
set -g base-index 1

set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
setw -g mode-mouse off

# make tmux display things in 256 colors
set -g default-terminal "screen-256color"

# set scrollback history to 10000 (10k)
set -g history-limit 10000

# set Ctrl-s as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-s
unbind C-b

# use send-prefix to pass C-a through to application
bind C-s send-prefix

# shorten command delay
set -sg escape-time 1


# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# map Vi selectio/copy keys
bind-key -t vi-copy 'v' begin-selection # Begin selection in copy mode.
bind-key -t vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode.
bind-key -t vi-copy 'y' copy-selection # Yank selection in copy mode


# resize panes using PREFIX H, J, K, L
bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key L resize-pane -R 5


#### COLOR (Solarized light)
#
## default statusbar colors
set-option -g status-bg white #base2
set-option -g status-fg yellow #yellow
set-option -g status-attr default
#
## default window title colors
set-window-option -g window-status-fg brightyellow #base00
set-window-option -g window-status-bg default
##set-window-option -g window-status-attr dim
#
## active window title colors
set-window-option -g window-status-current-fg brightred #orange
set-window-option -g window-status-current-bg default
##set-window-option -g window-status-current-attr bright
#
## pane border
set-option -g pane-border-fg white #base2
set-option -g pane-active-border-fg brightcyan #base1
#
## message text
set-option -g message-bg white #base2
set-option -g message-fg brightred #orange
#
## pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange
#
## clock
set-window-option -g clock-mode-colour green #green


# ----------------------
# Status Bar
# -----------------------
set -g status-right '#(~/.tmuxbar.sh)'
set-option -g status on                # turn the status bar on
set -g status-utf8 on                  # set utf-8 for the status bar
set -g status-interval 15              # set update frequency (default 15 seconds)
set -g status-justify centre           # center window list for clarity
# set-option -g status off                      # Hide tmux bar by default
bind-key a set -g status               # Toggle tmux bar visibility
# set-option -g status-position top    # position the status bar at top of screen

# visual notification of activity in other windows
# setw -g monitor-activity on
# set -g visual-activity on



#######################
# Tmux Plugin manager
#######################

# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins '              \
  tmux-plugins/tpm                 \
  tmux-plugins/tmux-sensible       \
  tmux-plugins/tmux-resurrect       \
  tmux-plugins/tmux-yank       \
'
# Other examples:
# github_username/plugin_name    \
# git@github.com/user/plugin     \
# git@bitbucket.com/user/plugin  \

# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'



.ratpoisonrc
Código:
#{{{ Bindigs
    # Escape
    escape C-g

    # Abort with ESC
    bind Escape abort

    # Only window
    unbind q
    bind o only

    # Start graphical terminal emulator instance
    bind c exec gnome-terminal

    # Give temporally control to DWM
    bind W tmpwm dwm

    # Close current window
    bind Q delete
    unbind C-k

    # Vi keys
    bind j focusdown
    bind h focusleft
    bind k focusup
    bind l focusright
    bind J exchangedown
    bind H exchangeleft
    bind K exchangeup
    bind L exchangeright

    # Vi splits
    unbind S
    bind s vsplit
    bind v hsplit
#}}}

# Banish the mouse pointer in every window change
addhook key banish

# Put cursor where it was previously
warp on

# Don't convert cursor in a box while waiting commands
set waitcursor 0

# Messages config
msgwait 2
startup_message off
set fgcolor black
set bgcolor papaya whip

# More informative date and time
bind a exec ratpoison -c "echo $( acpi -b | awk '{ print $3, $4 }' | tr -d ',' ) ||  $( date "+%F %r" )"

# If there is more than 1 screen, give focus to the second one
nextscreen

# vim:fdm=marker


Me han fascinado muchos ficheros de configuracion, buen post. Saludos cordiales desde Ecuador!
« Última modificación: 19 Agosto 2015, 21:41 pm por alx741 » En línea

qwartz 2.0

Desconectado Desconectado

Mensajes: 6


Ver Perfil WWW
Re: Postea tu .bashrc/alias/scripts/.vimrc
« Respuesta #38 en: 12 Julio 2017, 18:38 pm »

Ya es algo viejo el post pero igual y alguien le sirve :D

Dotfiles: https://github.com/qwartz2/dotfiles

VIM
Tengo la config. de vim dividida en varios archivos, solo por tener un poco mas organizado nada especial.
Código:
~/
.vimrc
.vim/
   |- vimrc/
      |- basic.vim
      |- plugins.vim
   |- colors/
       |- hybrid.vim
*hybrid.vim es el esquema de colores que utilizo para vim

~/.vimrc
Código
  1. source ~/.vim/vimrc/basic.vim
  2. source ~/.vim/vimrc/plugins.vim
  3.  

~/.vim/vimrc/basic.vim
Código
  1. "
  2. " Basic Config. of VIM
  3. " Author - @qwartz_
  4. "
  5.  
  6. " -----------------------
  7. " General
  8. " -----------------------
  9.  
  10. "/*
  11. set encoding=utf8
  12. set nocompatible
  13. set history=1000
  14. " set colorcolumn=80
  15. "*/
  16.  
  17. "/* Not Backup
  18. set noswapfile
  19. set nobackup
  20. "*/
  21.  
  22. "/* Indented
  23. set autoindent
  24. set expandtab        
  25. set shiftwidth=4
  26. set softtabstop=4
  27. "*/
  28.  
  29. "/* Folding
  30. set foldmethod=marker
  31. set foldmarker=/*,*/
  32. "*/
  33.  
  34. " -----------------------
  35. "  Interface
  36. " -----------------------
  37.  
  38. "/* Basic
  39. set background=dark
  40. colorscheme hybrid
  41. syntax on
  42. set number
  43. "*/
  44.  
  45. "/* More
  46. set relativenumber
  47. set cursorline
  48. set cursorcolumn
  49. set showmatch " opening and closing parentheses
  50. set mouse=a
  51. set ruler
  52. set laststatus=2 " status  bar
  53. set wildmenu " autocomplete bar
  54. set t_Co=256
  55. "*/
  56.  
  57. " -----------------------
  58. "  Basic Mapping
  59. " -----------------------
  60. let mapleader=","
  61.  
  62. "/* change column numbers
  63. nmap <F5> :set invrelativenumber<CR>
  64. imap <F5> <ESC>:set invrelativenumber<CR>a
  65. "*/
  66.  
  67. "/* resize panels
  68. nmap h :vertical res +2<CR>
  69. nmap l :vertical res -2<CR>  
  70. nmap j :res +2<CR>
  71. nmap k :res -2<CR>
  72. "*/
  73.  
  74. "/* split window
  75. nmap <Leader>h :split<CR>
  76. nmap <Leader>v :vsplit<CR>
  77. "*/
  78.  


~/.vim/vimrc/plugins.vim
Código
  1. " Plugins
  2. " Author - @qwartz_
  3. "
  4. " -----------------------
  5. "  Plugins
  6. " -----------------------
  7. call plug#begin('~/.vim/plugged')
  8.  
  9. "/* list plugins
  10. " Uncomment the plugins you want to install!
  11. " Basic;
  12. Plug 'jiangmiao/auto-pairs'
  13. Plug 'vim-scripts/AutoComplPop'
  14. Plug 'scrooloose/nerdtree'  
  15. "
  16. " More;
  17. "Plug 'ervandew/supertab'
  18. " ----> Snippets <----
  19. "Plug 'garbas/vim-snipmate'
  20. "Plug 'MarcWeber/vim-addon-mw-utils'
  21. "Plug 'tomtom/tlib_vim'
  22. "Plug 'garbas/vim-snipmate'
  23. "Plug 'honza/vim-snippets'
  24. "*/
  25. call plug#end()
  26.  
  27. " -----------------------
  28. "  Config. Plugins
  29. " -----------------------
  30.  
  31. "/* NERDTree
  32. nmap <Leader>nt :NERDTreeToggle<CR>
  33. let NERDTreeQuitOnOpen=1
  34. let NERDTreeWinSize=20
  35. "*/
  36.  

*Para instalar plugins utilizo: vim-plug















En línea

¿Eres un uno o un cero?
Páginas: 1 2 3 [4] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
¿Como se postea aqui una imagen? o una foto?
Sugerencias y dudas sobre el Foro
eR-GoMiNaS 1 3,367 Último mensaje 2 Octubre 2006, 20:17 pm
por el-brujo
[SOLUCIONADO][PROBLEMA]Error al recargar .bashrc
GNU/Linux
RyogiShiki 7 8,935 Último mensaje 22 Enero 2011, 18:07 pm
por RyogiShiki
Postea tu Desktop ! « 1 2 ... 30 31 »
GNU/Linux
j3d1 305 272,735 Último mensaje 31 Diciembre 2022, 18:54 pm
por BloodSharp
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines