~~stoggle_buttons~~ ====== Emacs ====== {{:1_iv-onecf-hvgi9vinbxwza.png?nolink&400|}} * [[https://launchpad.net/~kelleyk/+archive/ubuntu/emacs]] Para instalar en ubuntu ===== General ===== * ''M-x revert-buffer '' ===== org-mode ===== * ''M-x org-info'' -> Documentación de org-mode ====== Doom ====== * ''M-x all-the-icons-install-fonts RET'' Ya lo incluye por defecto ===== Atajos de teclado ===== * ''SPC f d'', ''SPC .'' (universal), ''SPC SPC'' -> Abrir carpeta * En modo dired, ''-'' para ir al directorio padre y ''RET'' para ir al hijo * ''C-x C-f RET'' Crear archivo * ''SPC f r, SPC f R'' -> Recientes * ''curl https://gist.github.com/hjertnes/9e14416e8962ff5f03c6b9871945b165 -o doom.org; cat doom.org | sed -E 's/ /*/g' | sed -E 's/([*]*)/*\1 /' > doom.org'' ===== Configuración ===== * Se edita en ~/.doom.d/ en vez de en ~/.emacs.d/, que no se tiene que tocar (archivos config.el, init.el, packages.el) * ''~/.emacs.d/bin/doom sync'' para recargar los cambios * ''~/.emacs.d/.local/elpa '' -> paquetes instalados por usuario, ''~/.emacs.d/modules'' -> paquetes instalados por doom ===== Paquetes ===== * NeoTree (como NerdTree en vim) ====== Sin clasificar ====== === Convertir org <-> md === * Para copiar y pegar markdown, hay que pasarle la regex: ''%%^([#|\*])(.*)$ -> ,$1$2%%'' [[https://orgmode.org/manual/Literal-Examples.html]] * ''%%pandoc -f markdown -t org -o file.org file.md%%'' * [[https://pandoc.org/]] * Se puede exportar de .org a .md en emacs ====== vim ====== ===== ppa con +clipboard ===== [[https://launchpad.net/~jonathonf/+archive/ubuntu/vim|ppa:jonathonf/vim]] ==== Links ==== * [[http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html]] * [[https://www.fprintf.net/vimCheatSheet.html]] * [[https://web.archive.org/web/20100725091217/http://briancarper.net/blog/448/vim-regexes-are-awesome|regexes]] Recopilación de muchas cosas * [[http://vimcasts.org/categories/]] * [[https://www.cs.oberlin.edu/~kuperman/help/vim/home.html]] * [[https://www.brianstorti.com/vim-registers/|registros]] * [[https://vim.fandom.com/wiki/Macros|Macros]] * [[http://vimregex.com/]] * [[https://catern.com/posts/terminal_quirks.html]] ==== Añadir ==== * [[https://stackoverflow.com/questions/24841544/how-to-display-only-errors-in-the-location-list]] * [[https://stackoverflow.com/questions/235839/indent-multiple-lines-quickly-in-vi]] * [[https://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim]] ==== Atajos ==== * ''Ctrl+W, S'', ''Ctrl+W, V'' Horizontal split y vertical split * ''Ctrl+W, hjkl'' para moverse entre paneles * ''Ctrl+['' se puede usar como reemplazo de ''ESC'' (también ''Ctrl+C'' pero no vale para emacs) ==== Snippets ==== Ruta de los snippets (son archivos de texto) /usr/share/vim/addons/snippets/ ==== Notes ==== w -> word, e -> end of word, b->back, W,E,B (vim word vs WORD) find (f, F) % matching parenthesis/brackets (go to left paren if the cursor is not at one) 0, $ start/end of line, gg, G start/end of file (^ start of line after indentation) *, # find word under cursor Goto line 4G 5G goto line 4, 5 (also :4, :5) Ctrl+G see current line /, ? search, search backwards; n, N next, previous match, also Ctrl+O, Ctrl+I i/I, a/A, o, O insert (before), append (after), insert newline below, insert newline above x, X delete character under cursor, to the left r, d, R replace, delete, Replace (switch to insert mode and overwrite) . repeat previous command u, Ctrl+R undo, redo. U to undo all line at once gt, gT next,previous tab (cyclic) {n}gT go to n tab d2w (the repeat command goes in the middle) c -> change ce -> change to the end of the word (cut to end of word and insert) c$ -> change to the end of line (cut to end of line and insert) :(\d,\d)?s/search/replace/ : g->multireplace per line c->prompt for each replace !command -> execute external command visual select + ESC :w -> save only that part/lines of the file :r FILE -> retrieve file (paste at cursor), also :r !COMMAND j$ -> move to next line end of line yw, ye yank from cursor to start/end of word fix typos moving characters xp -> move character under cursor forward x2hp -> move character under cursor backward swap two lines ddp -> swap with line below dd2kp -> swap with line above Y, (^y$, $y^ complicated) -> yank line without newline Advanced "g-" and "g+" commands -> multibranch undo/redo history ====== Emacs ====== ===== Emacs puro ===== **evil-mode** para usar atajos de vim dentro de emacs ''%%vim ~/.emacs.d/init.el%%'' (add-to-list 'load-path "~/.emacs.d/evil") (require 'evil) (evil-mode 1) (add-hook 'org-mode-hook #'visual-line-mode) * Seleccionar texto: click izquierdo para marcar el inicio, click derecho para marcar el final. * To cut the text, press ''C-w'' * To whack the text, press ''M-w'' (el símbolo ''M'' significa ''ESC'') * To yank the text, press ''C-y'' [[https://stackoverflow.com/questions/3527142/how-do-you-redo-changes-after-undo-with-emacs]] * To undo: ''%%C-_%%'' * To redo after a undo: ''%%C-g%%'', ''%%C-_%%'' * Guardar con ''C-x'', ''C-s'' ====== VSCodium ====== * Habilitar repos de Microsoft, porque no todos se portan a * https://github.com/VSCodium/vscodium/blob/master/DOCS.md#extensions-marketplace * En linux está en ''/usr/share/codium/resources/app/product.json'' * https://github.com/MicrosoftDocs/live-share/issues/262 sudo vim /usr/share/codium/resources/app/product.json // Hay que cambiar extensionsGallery: "extensionsGallery": { "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", "itemUrl": "https://marketplace.visualstudio.com/items" }, // VSCodium tiene: "extensionsGallery": { "serviceUrl": "https://open-vsx.org/vscode/gallery", "itemUrl": "https://open-vsx.org/vscode/item" },