From 9faf630efabad74366fef190e751c8af16e9fdc8 Mon Sep 17 00:00:00 2001 From: serxoz Date: Sun, 12 Sep 2021 22:18:18 +0200 Subject: [PATCH] first commit --- README.md | 41 +++++++++++++ clean | 20 +++++++ install | 21 +++++++ nvim/.config/nvim/init.vim | 118 +++++++++++++++++++++++++++++++++++++ tmux/.tmux.conf | 18 ++++++ 5 files changed, 218 insertions(+) create mode 100644 README.md create mode 100755 clean create mode 100755 install create mode 100644 nvim/.config/nvim/init.vim create mode 100644 tmux/.tmux.conf diff --git a/README.md b/README.md new file mode 100644 index 0000000..bdfd9a7 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# DOTFILES +Manejo de dotfiles con stow. + +## PREPARACIóN +- Crear dentro de ~/dotfiles un directorio con el nombre del programa, en este + ejemplo: "tmux". +- En su interior poner la misma estructura de archivos que tendría en nuestro + "home". En nuestro "home" sería: "~/.pinerc" así que dentro de "dotfiles" + quedaría: "~/dotfiles/tmux/.pinerc". + +## USO: +### Instalación de dotfiles: +```sh +cd ~/dotfiles +``` + +Si ejecutamos lo siguiente, hará una simulación de lo que ejecutará: +```sh +stow --adopt -nv tmux +``` + +Así vereremos que simulará crear un enlace desde "~/dotfiles/tmux/.pinerc" +hacia "~/.pinerc". Si quitamos el parámetro "n" hará la ejecución: +```sh +stow --adopt -v tmux +``` + +También, simplemente se puede ejecutar stow pasándole como parámetro la +carpeta de las dotfiles a instalar. Siguiendo el ejemplo sería: +```sh +stow tmux +``` + +### Desinstalación de dotfiles: +Para desinstalar en concreo las dotfiles de un programa, seguimos con el +ejemplo del tmux: +```sh +cd ~/dotfiles +stow -D tmux +``` + diff --git a/clean b/clean new file mode 100755 index 0000000..ec30cf6 --- /dev/null +++ b/clean @@ -0,0 +1,20 @@ +#!/bin/sh + +# Desinstalación de dotfiles con stow. +# Por cada directorio desinstala. + +for i in `ls` +do + case $i in + README*) + ;; + install*) + ;; + clean*) + ;; + *) + echo "Borrando dotfiles para $i..." + stow -D $i + ;; + esac +done diff --git a/install b/install new file mode 100755 index 0000000..0c33ad8 --- /dev/null +++ b/install @@ -0,0 +1,21 @@ +#!/bin/sh + +# Instalación de dotfiles con stow. +# Por cada directorio desinstala e instala. + +for i in `ls` +do + case $i in + README*) + ;; + install*) + ;; + clean*) + ;; + *) + echo "Instando dotfiles para $i..." + stow -D $i + stow $i + ;; + esac +done diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim new file mode 100644 index 0000000..360fa59 --- /dev/null +++ b/nvim/.config/nvim/init.vim @@ -0,0 +1,118 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" CONFIGURACIÓN BÁSICA +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Codificación +set encoding=utf-8 +set fileencoding=utf-8 +set fileencodings=utf-8 +set fileformats=unix,dos,mac + +" Arregla identación por backspace +set backspace=indent,eol,start + +" Linea infinita +set nowrap + +" Tabulaciones +set tabstop=4 +set softtabstop=0 +set shiftwidth=4 +set expandtab + +" Búsqueda +set hlsearch +set incsearch +set ignorecase +set smartcase + +" Mapea la tecla líder a , +let mapleader=',' + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" CONFIGURACIÓN VISUAL +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Sintaxis +syntax on + +" Linea de estado +set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\ + +" Números de linea +set rnu +set nu +set scrolloff=4 "no haga scroll cuando faltan 4 lineas + +" Marca en la columan 80 +set colorcolumn=80 +highlight ColorColumn ctermbg=238 + +" Centra el resultado de las busquedas para mejor enfoque +nnoremap n nzzzv +nnoremap N Nzzzv + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" VIM-PLUG CORE +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim') + +let g:vim_bootstrap_langs = "go,html,javascript,python" +let g:vim_bootstrap_editor = "nvim" " nvim or vim + +if !filereadable(vimplug_exists) + if !executable("curl") + echoerr "You have to install curl or first install vim-plug yourself!" + execute "q!" + endif + echo "Installing Vim-Plug..." + echo "" + silent exec "!\curl -fLo " . vimplug_exists . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" + let g:not_finish_vimplug = "yes" + + autocmd VimEnter * PlugInstall +endif + +" Required: +call plug#begin(expand('~/.config/nvim/plugged')) + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" INSTALACIÓN DE PLUGGINS +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +Plug 'scrooloose/nerdtree' +Plug 'jistr/vim-nerdtree-tabs' +Plug 'tpope/vim-commentary' + + +"" NERDTree configuration +let g:NERDTreeChDirMode=2 +let g:NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__'] +let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$'] +let g:NERDTreeShowBookmarks=1 +let g:nerdtree_tabs_focus_on_files=1 +let g:NERDTreeMapOpenInTabSilent = '' +let g:NERDTreeWinSize = 50 +set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite +nnoremap :NERDTreeFind +nnoremap :NERDTreeToggle + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Mapeos +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" Limpia busqueda +nnoremap :noh + +" Pestañas +nnoremap gt +nnoremap gT +nnoremap :tabnew + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" POR HACER +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" lsp +" treesitter +" sistema para buscar: telescope, harpoon, fuzzyfinder, grep... +" +" desde que puse la config de nerdtree no fuciona vim-commentary... :S + diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..64cf18b --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,18 @@ +# default window title colors +set-window-option -g window-status-fg colour245 # base0 +set-window-option -g window-status-bg default + +# active window title colors +set-window-option -g window-status-current-fg colour252 # orange +set-window-option -g window-status-current-bg default + +# clean status bar +set -g status-right '' +set -g status-left ' ' +set -g status-bg colour240 + +# use mouse to scroll - remember select with shift +setw -g mouse on + +# weechat +set -g default-terminal "tmux-256color"