-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.json
1 lines (1 loc) · 36.1 KB
/
index.json
1
[{"content":"Exit nvim editor vim or nvim are text editors based on the command line. If you dont know how to exit the nvim interface you shoul type esc + esc then write :q\n:q is the command to leave the nvim or vim editor. nvim modes Normal: You should type esc + esc Insert: You should type i Visual: You should type v Move the cursor in the text In Normal mode of nvim we can use the arrow keys to move in the text but there is a better solution, we can use the right hand using the h, j, k, l keys.\nh move to the right l move to the left j move down k move up If we want to move faster forwar we can use the key w and if we can move faster backward we can use b. In the same Normal Mode if we need to me fast forward but at the end of the word we should press the key e.\nFinally if we neet to reach the end of a long sentence (line in Normal Mode) we can use the symbol $.\nNote: The purpose of use vim is to rid from the mouse to navigate faster in your editor only with the keyboard.\nInsert text How to insert text in nvim?\nThe easy way is to press i key place the text we want and then press esc + esc Note: If we press esc only one, the editor delay the change from insert mode to the normal mode.\nThere is other way to insert text, this is with a key. After placing this key we can insert text in front of the cursor.\nIf we type A in Normal Mode we will be able to write text at the end of a line. In other words, the Insert Mode is activate at the end of the line.\nDelete text In Normal Mode we place the cursor on the line and word we want to eliminate then we press the letter x Save the file The first way is to use :w to write the text The second way is to use the command :wq which will save your file but nvim will close the file too. Navigate between files Remeber, to navigate and apply any command we should be in Normal Mode\ngd in the same text we can pres gd to reach the definition gif this command will move you to the new file (opening a buffer) ctr + o Buffer backward ctr + i Vuffer forward Eliminate lines and order lines To eliminate a whole line we should place the cursor at the beggining of the line, then we will press dd to cut the line and then I move the cursor into the line I want to paste the line:\nUse \u0026lt;p\u0026gt; to place one line below the cursor Use \u0026lt;P\u0026gt; to paste the line one line above where the cursor is. Note: In vim we do not eliminate text, we are cutting with \u0026lt;dd\u0026gt;\nReplace text in vim The command replace in nvim works in Normal Mode. First we need to place the cursor infront the letter we want to replace then press \u0026lt;r\u0026gt; and write the new letter.\nIf we want to replace a whole word we can place the cursor at the beggining of the word then type \u0026lt;cw\u0026gt; which means change word. In other words the word is delete to place your new word.\nThere is a third command we can use to chane a whole word and this is \u0026lt;ciw\u0026gt; which means change inner word. This command while delete the whole word no mather where is placed the cursor. The only requirement is we need to be on the desired word.\nJump between lines and text search The command which send you to the beggining of the document we need to press two times de g letter \u0026lt;gg\u0026gt; If we want to go to the end of the file we should type \u0026lt;G\u0026gt; the capital letter G. To search text we will go to Normal Mode and write the text after a forward slash /search text. This command will search from the position of the cursor. To navigate between highlighted words we only press \u0026lt;n\u0026gt;. Jump between parenthesis This command is useful for programming (dictonaries in python, for example). To jump between parenthesis we need to press \u0026lt;%\u0026gt; in the keyboard we obtain the % by pressing shift + 5. Copy and paste To copy text we need to change to the Visua Mode. Then for getting the visual mode I need to press \u0026lt;v\u0026gt;. Inmediatly if we move the cursor, the text will be selected.\nTo copy the text we need to type \u0026lt;y\u0026gt; To paste the text in Normal mode we need to type \u0026lt;p\u0026gt;\n","permalink":"https://jesuscapistran.github.io/post/2022/nvim_tutorial/","summary":"Exit nvim editor vim or nvim are text editors based on the command line. If you dont know how to exit the nvim interface you shoul type esc + esc then write :q\n:q is the command to leave the nvim or vim editor. nvim modes Normal: You should type esc + esc Insert: You should type i Visual: You should type v Move the cursor in the text In Normal mode of nvim we can use the arrow keys to move in the text but there is a better solution, we can use the right hand using the h, j, k, l keys.","title":"commands to work in nvim"},{"content":"NeoVim or nvim is a text editor based on the terminal, it is used to edit plain text or even for programming. In my case I decided to set up my nvim for writting in markdown. To have this configuration it is neccesary to cofig NeoVim.\nThis modification were based on two sources:\njdhao webpage (She is a machine learning engineer): Markdown Writing and previewing in NeoVim - A complete Guide Nicolas Schourmann (Programmer, New Zeland): Vim, aumenta tu velocidad de desarrollo Following jdhao tutorial + Nicolar Shourman course you can learn to customize your nvim enviroment and even you will learn to use the nvim editor.\nWhat is nvim How to use nvim How to install pluggins Custumize youy nvim for markdwon writing My nvim config file The easy way to tune nvim for Markdown writing is to implement my confi file. Here you need to find the init.vim located in the .config/nvim folder. To acces this file you should go to nvim folder and there write nvim init.vim\nHere I share my configuration file, pay attention to the following plugins:\njiangmiao/auto-pairs: auto complete parenthesus ( ),{ },[ ] junegunn/goyo.vim (this shows a focus mode for writing) SirVer/ultisnips (add snippets to accelerate Markdown writing) honza/vim-snippets (add snippets to accelerate Markdown writing) plasticboy/vim-markdown (Very important, add highlight and conceal Markdown) iamcco/markdown-preview.nvim (You can preview Markdown file in local) set number set clipboard=unnamed set tabstop=4 set shiftwidth=4 set smartindent set mouse=a syntax enable set showcmd set encoding=utf-8 set showmatch set relativenumber call plug#begin(\u0026#39;~/.vim/plugged\u0026#39;) \u0026#34; Gruvbox Themes Plug \u0026#39;sainnhe/gruvbox-material\u0026#39; \u0026#34; Easy motion - Jump inside text Plug \u0026#39;easymotion/vim-easymotion\u0026#39; \u0026#34; LSP Plug \u0026#39;neovim/nvim-lspconfig\u0026#39; Plug \u0026#39;nvim-lua/completion-nvim\u0026#39; Plug \u0026#39;neoclide/coc.nvim\u0026#39;, {\u0026#39;branch\u0026#39;: \u0026#39;master\u0026#39;, \u0026#39;do\u0026#39;: \u0026#39;yarn install --frozen-lockfile\u0026#39;} \u0026#34; Indent lines Plug \u0026#39;Yggdroot/indentLIne\u0026#39; \u0026#34; Airline (TAB) Plug \u0026#39;vim-airline/vim-airline\u0026#39; \u0026#34; Directories tree configuration Plug \u0026#39;scrooloose/nerdtree\u0026#39; \u0026#34; Dev icons \u0026#34; Plug \u0026#39;ryanoasis/vim-devicons\u0026#39; \u0026#34; Auto pairs Plug \u0026#39;jiangmiao/auto-pairs\u0026#39; \u0026#34; Grammar check for English \u0026#34; Plug \u0026#39;rhysd/vim-grammarous\u0026#39; \u0026#34;Goyo for Zen Mode Plug \u0026#39;junegunn/goyo.vim\u0026#39; \u0026#34; Interactive jupyter-notebook Plug \u0026#39;jupyter-vim/jupyter-vim\u0026#39; \u0026#34; Markdown snippets Plug \u0026#39;SirVer/ultisnips\u0026#39; Plug \u0026#39;honza/vim-snippets\u0026#39; \u0026#34; tabular plugin is used to format tables Plug \u0026#39;godlygeek/tabular\u0026#39; \u0026#34; JSON front matter highlight plugin Plug \u0026#39;elzr/vim-json\u0026#39; Plug \u0026#39;plasticboy/vim-markdown\u0026#39; \u0026#34;Plug \u0026#39;vim-pandoc/vim-pandoc-syntax\u0026#39; \u0026#34; Markdown preview Plug \u0026#39;iamcco/markdown-preview.nvim\u0026#39;, { \u0026#39;do\u0026#39;: \u0026#39;cd app \u0026amp;\u0026amp; yarn install\u0026#39; } call plug#end() \u0026#34; GRUVBOX Configuration set background=dark let g:gruvbox_material_background=\u0026#39;medium\u0026#39; colorscheme gruvbox-material \u0026#34; Easy motion Configuran let mapleader=\u0026#34; \u0026#34; nmap s \u0026lt;Plug\u0026gt;(easymotion-s2) nmap t \u0026lt;Plug\u0026gt;(easymotion-t2) \u0026#34; LSP configuration lua\u0026lt;\u0026lt; EOF require\u0026#39;lspconfig\u0026#39;.pyright.setup{on_attach=require\u0026#39;completion\u0026#39;.on_attach} EOF \u0026#34; Airline configuration let g:airline#extensions#tabline#enabled = 1 \u0026#34; Nerd tree - directorie configuration let NERDTreeQuitOnOpen= 1 nnoremap \u0026lt;silent\u0026gt; \u0026lt;F2\u0026gt; :NERDTreeFind\u0026lt;CR\u0026gt; nnoremap \u0026lt;silent\u0026gt; \u0026lt;F3\u0026gt; :NERDTreeToggle\u0026lt;CR\u0026gt; \u0026#34; Jupyter Qtconsole configuration \u0026#34; Run current file nnoremap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;R :JupyterRunFile\u0026lt;CR\u0026gt; nnoremap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;I :PythonImportThisFile\u0026lt;CR\u0026gt; \u0026#34; Change to directory of current file nnoremap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;d :JupyterCd %:p:h\u0026lt;CR\u0026gt; \u0026#34; Send a selection of lines nnoremap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;X :JupyterSendCell\u0026lt;CR\u0026gt; nnoremap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;E :JupyterSendRange\u0026lt;CR\u0026gt; nmap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;e \u0026lt;Plug\u0026gt;JupyterRunTextObj vmap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;e \u0026lt;Plug\u0026gt;JupyterRunVisual \u0026#34; Debugging maps nnoremap \u0026lt;buffer\u0026gt; \u0026lt;silent\u0026gt; \u0026lt;localleader\u0026gt;b :PythonSetBreak\u0026lt;CR\u0026gt; \u0026#34;------------------------------ \u0026#34; Markdown Configuration begins \u0026#34; ----------------------------- \u0026#34; URL https://jdhao.github.io/2019/01/15/markdown_edit_preview_nvim/ \u0026#34; Do not use \u0026lt;tab\u0026gt; if you use https://github.com/Valloric/YouCompleteMe. let g:UltiSnipsExpandTrigger=\u0026#34;\u0026lt;tab\u0026gt;\u0026#34; \u0026#34; use \u0026lt;Tab\u0026gt; to trigger autocompletion let g:UltiSnipsJumpForwardTrigger=\u0026#34;\u0026lt;c-j\u0026gt;\u0026#34; let g:UltiSnipsJumpBackwardTrigger=\u0026#34;\u0026lt;c-k\u0026gt;\u0026#34; \u0026#34; disable header folding let g:vim_markdown_folding_disabled = 1 \u0026#34; do not use conceal feature, the implementation is not so good \u0026#34;Markdown conceal configurations \u0026#34;URL: https://github.com/preservim/vim-markdown#options let g:vim_markdown_conceal = 0 let g:tex_conceal = \u0026#34;\u0026#34; let g:vim_markdown_math = 1 let g:vim_markdown_conceal_code_blocks = 0 \u0026#34; support front matter of various format let g:vim_markdown_frontmatter = 1 \u0026#34; for YAML format let g:vim_markdown_toml_frontmatter = 1 \u0026#34; for TOML format let g:vim_markdown_json_frontmatter = 1 \u0026#34; for JSON format \u0026#34; Pandoc syntax configuration \u0026#34;augroup pandoc_syntax \u0026#34; au! BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc \u0026#34;augroup END \u0026#34;Markdown preview \u0026#34;URL: https://github.com/iamcco/markdown-preview.nvim \u0026#34; do not close the preview tab when switching to other buffers let g:mkdp_auto_close = 0 nnoremap \u0026lt;M-m\u0026gt; :MarkdownPreview\u0026lt;CR\u0026gt; \u0026#34;-------------------------- \u0026#34;Markdown configuration ends \u0026#34;--------------------------- \u0026#34;------------------------ \u0026#34; COC configuration begin \u0026#34;------------------------ \u0026#34; Set internal encoding of vim, not needed on neovim, since coc.nvim using some \u0026#34; unicode characters in the file autoload/float.vim \u0026#34; :wset encoding=utf-8 \u0026#34; TextEdit might fail if hidden is not set. set hidden \u0026#34; Some servers have issues with backup files, see #649. set nobackup set nowritebackup \u0026#34; Give more space for displaying messages. set cmdheight=2 \u0026#34; Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable \u0026#34; delays and poor user experience. set updatetime=300 \u0026#34; Don\u0026#39;t pass messages to |ins-completion-menu|. set shortmess+=c \u0026#34; Always show the signcolumn, otherwise it would shift the text each time \u0026#34; diagnostics appear/become resolved. if has(\u0026#34;nvim-0.5.0\u0026#34;) || has(\u0026#34;patch-8.1.1564\u0026#34;) \u0026#34; Recently vim can merge signcolumn and number column into one set signcolumn=number else set signcolumn=yes endif \u0026#34; Use tab for trigger completion with characters ahead and navigate. \u0026#34; NOTE: Use command \u0026#39;:verbose imap \u0026lt;tab\u0026gt;\u0026#39; to make sure tab is not mapped by \u0026#34; other plugin before putting this into your config. inoremap \u0026lt;silent\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;TAB\u0026gt; \\ pumvisible() ? \u0026#34;\\\u0026lt;C-n\u0026gt;\u0026#34; : \\ CheckBackspace() ? \u0026#34;\\\u0026lt;TAB\u0026gt;\u0026#34; : \\ coc#refresh() inoremap \u0026lt;expr\u0026gt;\u0026lt;S-TAB\u0026gt; pumvisible() ? \u0026#34;\\\u0026lt;C-p\u0026gt;\u0026#34; : \u0026#34;\\\u0026lt;C-h\u0026gt;\u0026#34; function! CheckBackspace() abort let col = col(\u0026#39;.\u0026#39;) - 1 return !col || getline(\u0026#39;.\u0026#39;)[col - 1] =~# \u0026#39;\\s\u0026#39; endfunction \u0026#34; Use \u0026lt;c-space\u0026gt; to trigger completion. if has(\u0026#39;nvim\u0026#39;) inoremap \u0026lt;silent\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;c-space\u0026gt; coc#refresh() else inoremap \u0026lt;silent\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;c-@\u0026gt; coc#refresh() endif \u0026#34; Make \u0026lt;CR\u0026gt; auto-select the first completion item and notify coc.nvim to \u0026#34; format on enter, \u0026lt;cr\u0026gt; could be remapped by other vim plugin inoremap \u0026lt;silent\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;cr\u0026gt; pumvisible() ? coc#_select_confirm() \\: \u0026#34;\\\u0026lt;C-g\u0026gt;u\\\u0026lt;CR\u0026gt;\\\u0026lt;c-r\u0026gt;=coc#on_enter()\\\u0026lt;CR\u0026gt;\u0026#34; \u0026#34; Use `[g` and `]g` to navigate diagnostics \u0026#34; Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap \u0026lt;silent\u0026gt; [g \u0026lt;Plug\u0026gt;(coc-diagnostic-prev) nmap \u0026lt;silent\u0026gt; ]g \u0026lt;Plug\u0026gt;(coc-diagnostic-next) \u0026#34; GoTo code navigation. nmap \u0026lt;silent\u0026gt; gd \u0026lt;Plug\u0026gt;(coc-definition) nmap \u0026lt;silent\u0026gt; gy \u0026lt;Plug\u0026gt;(coc-type-definition) nmap \u0026lt;silent\u0026gt; gi \u0026lt;Plug\u0026gt;(coc-implementation) nmap \u0026lt;silent\u0026gt; gr \u0026lt;Plug\u0026gt;(coc-references) \u0026#34; Use K to show documentation in preview window. nnoremap \u0026lt;silent\u0026gt; K :call ShowDocumentation()\u0026lt;CR\u0026gt; function! ShowDocumentation() if CocAction(\u0026#39;hasProvider\u0026#39;, \u0026#39;hover\u0026#39;) call CocActionAsync(\u0026#39;doHover\u0026#39;) else call feedkeys(\u0026#39;K\u0026#39;, \u0026#39;in\u0026#39;) endif endfunction \u0026#34; Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync(\u0026#39;highlight\u0026#39;) \u0026#34; Symbol renaming. nmap \u0026lt;leader\u0026gt;rn \u0026lt;Plug\u0026gt;(coc-rename) \u0026#34; Formatting selected code. xmap \u0026lt;leader\u0026gt;f \u0026lt;Plug\u0026gt;(coc-format-selected) nmap \u0026lt;leader\u0026gt;f \u0026lt;Plug\u0026gt;(coc-format-selected) augroup mygroup autocmd! \u0026#34; Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction(\u0026#39;formatSelected\u0026#39;) \u0026#34; Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync(\u0026#39;showSignatureHelp\u0026#39;) augroup end \u0026#34; Applying codeAction to the selected region. \u0026#34; Example: `\u0026lt;leader\u0026gt;aap` for current paragraph xmap \u0026lt;leader\u0026gt;a \u0026lt;Plug\u0026gt;(coc-codeaction-selected) nmap \u0026lt;leader\u0026gt;a \u0026lt;Plug\u0026gt;(coc-codeaction-selected) \u0026#34; Remap keys for applying codeAction to the current buffer. nmap \u0026lt;leader\u0026gt;ac \u0026lt;Plug\u0026gt;(coc-codeaction) \u0026#34; Apply AutoFix to problem on the current line. nmap \u0026lt;leader\u0026gt;qf \u0026lt;Plug\u0026gt;(coc-fix-current) \u0026#34; Run the Code Lens action on the current line. nmap \u0026lt;leader\u0026gt;cl \u0026lt;Plug\u0026gt;(coc-codelens-action) \u0026#34; Map function and class text objects \u0026#34; NOTE: Requires \u0026#39;textDocument.documentSymbol\u0026#39; support from the language server. xmap if \u0026lt;Plug\u0026gt;(coc-funcobj-i) omap if \u0026lt;Plug\u0026gt;(coc-funcobj-i) xmap af \u0026lt;Plug\u0026gt;(coc-funcobj-a) omap af \u0026lt;Plug\u0026gt;(coc-funcobj-a) xmap ic \u0026lt;Plug\u0026gt;(coc-classobj-i) omap ic \u0026lt;Plug\u0026gt;(coc-classobj-i) xmap ac \u0026lt;Plug\u0026gt;(coc-classobj-a) omap ac \u0026lt;Plug\u0026gt;(coc-classobj-a) \u0026#34; Remap \u0026lt;C-f\u0026gt; and \u0026lt;C-b\u0026gt; for scroll float windows/popups. if has(\u0026#39;nvim-0.4.0\u0026#39;) || has(\u0026#39;patch-8.2.0750\u0026#39;) nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;C-f\u0026gt; coc#float#has_scroll() ? coc#float#scroll(1) : \u0026#34;\\\u0026lt;C-f\u0026gt;\u0026#34; nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;C-b\u0026gt; coc#float#has_scroll() ? coc#float#scroll(0) : \u0026#34;\\\u0026lt;C-b\u0026gt;\u0026#34; inoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;C-f\u0026gt; coc#float#has_scroll() ? \u0026#34;\\\u0026lt;c-r\u0026gt;=coc#float#scroll(1)\\\u0026lt;cr\u0026gt;\u0026#34; : \u0026#34;\\\u0026lt;Right\u0026gt;\u0026#34; inoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;C-b\u0026gt; coc#float#has_scroll() ? \u0026#34;\\\u0026lt;c-r\u0026gt;=coc#float#scroll(0)\\\u0026lt;cr\u0026gt;\u0026#34; : \u0026#34;\\\u0026lt;Left\u0026gt;\u0026#34; vnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;C-f\u0026gt; coc#float#has_scroll() ? coc#float#scroll(1) : \u0026#34;\\\u0026lt;C-f\u0026gt;\u0026#34; vnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt;\u0026lt;expr\u0026gt; \u0026lt;C-b\u0026gt; coc#float#has_scroll() ? coc#float#scroll(0) : \u0026#34;\\\u0026lt;C-b\u0026gt;\u0026#34; endif \u0026#34; Use CTRL-S for selections ranges. \u0026#34; Requires \u0026#39;textDocument/selectionRange\u0026#39; support of language server. nmap \u0026lt;silent\u0026gt; \u0026lt;C-s\u0026gt; \u0026lt;Plug\u0026gt;(coc-range-select) xmap \u0026lt;silent\u0026gt; \u0026lt;C-s\u0026gt; \u0026lt;Plug\u0026gt;(coc-range-select) \u0026#34; Add `:Format` command to format current buffer. command! -nargs=0 Format :call CocActionAsync(\u0026#39;format\u0026#39;) \u0026#34; Add `:Fold` command to fold current buffer. command! -nargs=? Fold :call CocAction(\u0026#39;fold\u0026#39;, \u0026lt;f-args\u0026gt;) \u0026#34; Add `:OR` command for organize imports of the current buffer. command! -nargs=0 OR :call CocActionAsync(\u0026#39;runCommand\u0026#39;, \u0026#39;editor.action.organizeImport\u0026#39;) \u0026#34; Add (Neo)Vim\u0026#39;s native statusline support. \u0026#34; NOTE: Please see `:h coc-status` for integrations with external plugins that \u0026#34; provide custom statusline: lightline.vim, vim-airline. set statusline^=%{coc#status()}%{get(b:,\u0026#39;coc_current_function\u0026#39;,\u0026#39;\u0026#39;)} \u0026#34; Mappings for CoCList \u0026#34; Show all diagnostics. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;a :\u0026lt;C-u\u0026gt;CocList diagnostics\u0026lt;cr\u0026gt; \u0026#34; Manage extensions. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;e :\u0026lt;C-u\u0026gt;CocList extensions\u0026lt;cr\u0026gt; \u0026#34; Show commands. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;c :\u0026lt;C-u\u0026gt;CocList commands\u0026lt;cr\u0026gt; \u0026#34; Find symbol of current document. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;o :\u0026lt;C-u\u0026gt;CocList outline\u0026lt;cr\u0026gt; \u0026#34; Search workspace symbols. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;s :\u0026lt;C-u\u0026gt;CocList -I symbols\u0026lt;cr\u0026gt; \u0026#34; Do default action for next item. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;j :\u0026lt;C-u\u0026gt;CocNext\u0026lt;CR\u0026gt; \u0026#34; Do default action for previous item. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;k :\u0026lt;C-u\u0026gt;CocPrev\u0026lt;CR\u0026gt; \u0026#34; Resume latest coc list. nnoremap \u0026lt;silent\u0026gt;\u0026lt;nowait\u0026gt; \u0026lt;space\u0026gt;p :\u0026lt;C-u\u0026gt;CocListResume\u0026lt;CR\u0026gt; \u0026#34;---------------------- \u0026#34; COC configuration end \u0026#34;---------------------- \u0026#34; ","permalink":"https://jesuscapistran.github.io/post/2022/nvim_markdown_test/","summary":"NeoVim or nvim is a text editor based on the terminal, it is used to edit plain text or even for programming. In my case I decided to set up my nvim for writting in markdown. To have this configuration it is neccesary to cofig NeoVim.\nThis modification were based on two sources:\njdhao webpage (She is a machine learning engineer): Markdown Writing and previewing in NeoVim - A complete Guide Nicolas Schourmann (Programmer, New Zeland): Vim, aumenta tu velocidad de desarrollo Following jdhao tutorial + Nicolar Shourman course you can learn to customize your nvim enviroment and even you will learn to use the nvim editor.","title":"nvim for writing in markdown"},{"content":"It has been a week since I configured and deployed my Blog with Hugo, I have notpost anyhting since then. Then Today I have experience a lot of trouble in the workflow for posting. That means, the new skill which is not training is inmediatly forgotten. Then lest write this mini guide to get back and remember the posting worflow in Hugo.\n1. Create a new Markdown file with Hugo The Hugo post should be write locally using a Markdown editor. To create the new file is important to enter into your repository. Mine is called CodeNotes\nDirectory: Github/blog/CodeNotes Github is the folder where I store all my Github repositories blog is a new folder where I will test every Hugo Blog I will create to learn. In this case the only blog is called CodeNotes. CodeNotes contains the HugoBlog, this is the place we will be working. Lets go to the CodeNote folder and create the new entry:\ncd blog/Codenotes hugo new content/post/2022/hugo_post_workflow.md The command hugo new will create a markdown file in content/post/2022/file.md This command is important because the new file will create markdown file with the following front matter. The basic structure includes the title:, date, and draft. Therefore, the following infor should be added.\n--- title: \u0026#34;Hugo workflow for posting a blog\u0026#34; date: 2022-07-03T09:45:32-05:00 draft: true author: \u0026#34;Jesus Capistran\u0026#34; tags: [\u0026#34;python\u0026#34;, \u0026#34;hugo\u0026#34;] --- 3. Preview your file in Hugo Server Now is time to preview the file you are writing. This can be achieved by using the command Hugo Server. This command will create a local server to explore how your post its going to look once the html files are deployed.\nGo to CodeNotes folder write: Hugo server Preview yor file by opening the link generated link: http://localhost:1313/\n(base) ➜ Github cd blog/code_notes (base) ➜ code_notes git:(main) ✗ hugo server Start building sites … hugo v0.101.0+extended darwin/amd64 BuildDate=unknown | EN -------------------+----- Pages | 22 Paginator pages | 0 Non-page files | 0 Static files | 0 Processed images | 0 Aliases | 5 Sitemaps | 1 Cleaned | 0 Built in 124 ms Watching for changes in /Users/capis/Documents/Github/blog/code_notes/{archetypes,content,data,layouts,static,themes} Watching for config changes in /Users/capis/Documents/Github/blog/code_notes/config.yml Environment: \u0026#34;development\u0026#34; Serving pages from memory Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) Press Ctrl+C to stop 4. Create the public folder(HTML files) Once you are satisfied with the local results for your bew blog post, is time to convert the markdown files into html. For this task there is no other think to do than write Hugo in ther CodeNotes folder.\nLet\u0026rsquo;s do it:\nStart building sites … hugo v0.101.0+extended darwin/amd64 BuildDate=unknown | EN -------------------+----- Pages | 25 Paginator pages | 0 Non-page files | 0 Static files | 0 Processed images | 0 Aliases | 6 Sitemaps | 1 Cleaned | 0 Total in 240 ms (base) ➜ code_notes git:(main) ✗ After using Hugo command the html are generated in the public folder CodeNotes/Public. Is this folder which contains the whole Hugo Blog (html pages) which form your statis site.\nAs you can see, every time you create a blog post, all the html sites should be generated. Let\u0026rsquo;s deplot the Public folder into Github Pages.\n5. Deploy into Github Pages The new post was created locally, next we preview it using Hugo server, and we create the html files using hugo, now is time to deploy the Public folder into github pages.\nNote: Remember the Public folder is linked to a second repository in github. That means the first repository called CodeNotes will contain the markdown files and the second repository will contain the html files we are generating in the public folder.\n(base) ➜ code_notes git:(main) ✗ cd public (base) ➜ public git:(main) ✗ git add . (base) ➜ public git:(main) ✗ git commit -m \u0026#34;post July 03, Hugo posting workflow\u0026#34; [main 17dc849] post July 03, Hugo posting workflow 23 files changed, 179 insertions(+), 84 deletions(-) rewrite archives/index.html (66%) rewrite index.html (83%) rewrite index.json (96%) create mode 100644 post/2022/hugo_post_workflow/index.html rewrite post/hugo_tutorial/index.html (76%) rewrite post/index.html (63%) rewrite post/welcome_code_notes/index.html (74%) create mode 100644 tags/hugo/index.html create mode 100644 tags/hugo/index.xml create mode 100644 tags/hugo/page/1/index.html (base) ➜ public git:(main) That\u0026rsquo;s all, now you can wait aproximately 1 minute and check your online webpage:\nThis is mine: http://jesuscapistran.github.io/ If you want to check How to deploy a new Hugo Site into Github Pages follow the video of my second post: Deplot a Hugo blog in Github\n","permalink":"https://jesuscapistran.github.io/post/2022/hugo_post_workflow/","summary":"It has been a week since I configured and deployed my Blog with Hugo, I have notpost anyhting since then. Then Today I have experience a lot of trouble in the workflow for posting. That means, the new skill which is not training is inmediatly forgotten. Then lest write this mini guide to get back and remember the posting worflow in Hugo.\n1. Create a new Markdown file with Hugo The Hugo post should be write locally using a Markdown editor.","title":"Hugo workflow for posting a blog"},{"content":"July 02, 2022 Filter data in python with high order functions This project (Platzi) is to learn How to filter data from a list of dictionaries. The goal is to use the python high order functions filter() and map() to achieve the task. Note: You will require python \u0026gt; v3.9 to finish the 100% of the examples. However if you have only python 3 you can achieve the 90%. Don\u0026rsquo;t worry, let\u0026rsquo;s practice.\nThe filter( ) , map ( ), and reduce ( ) functions simplifies the process of working with lists and dictionaries.\nList of dictionaries This is the list of dictionaries provided by Platzi where we will perform some filter tasks. Take a look to the name of the dictionary DATA is capitalized, this means the list of dictionary will be a constant along the program.\nDATA = [ { \u0026#39;name\u0026#39;: \u0026#39;Facundo\u0026#39;, \u0026#39;age\u0026#39;: 72, \u0026#39;organization\u0026#39;: \u0026#39;Platzi\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Technical Coach\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;python\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Luisana\u0026#39;, \u0026#39;age\u0026#39;: 33, \u0026#39;organization\u0026#39;: \u0026#39;Globant\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;UX Designer\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;javascript\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Héctor\u0026#39;, \u0026#39;age\u0026#39;: 19, \u0026#39;organization\u0026#39;: \u0026#39;Platzi\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Associate\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;ruby\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Gabriel\u0026#39;, \u0026#39;age\u0026#39;: 20, \u0026#39;organization\u0026#39;: \u0026#39;Platzi\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Associate\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;javascript\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Isabella\u0026#39;, \u0026#39;age\u0026#39;: 30, \u0026#39;organization\u0026#39;: \u0026#39;Platzi\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;QA Manager\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;java\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Karo\u0026#39;, \u0026#39;age\u0026#39;: 23, \u0026#39;organization\u0026#39;: \u0026#39;Everis\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Backend Developer\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;python\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Ariel\u0026#39;, \u0026#39;age\u0026#39;: 32, \u0026#39;organization\u0026#39;: \u0026#39;Rappi\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Support\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Juan\u0026#39;, \u0026#39;age\u0026#39;: 17, \u0026#39;organization\u0026#39;: \u0026#39;\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Student\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;go\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Pablo\u0026#39;, \u0026#39;age\u0026#39;: 32, \u0026#39;organization\u0026#39;: \u0026#39;Master\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Human Resources Manager\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;python\u0026#39;, }, { \u0026#39;name\u0026#39;: \u0026#39;Lorena\u0026#39;, \u0026#39;age\u0026#39;: 56, \u0026#39;organization\u0026#39;: \u0026#39;Python Organization\u0026#39;, \u0026#39;position\u0026#39;: \u0026#39;Language Maker\u0026#39;, \u0026#39;language\u0026#39;: \u0026#39;python\u0026#39;, }, ] Filter the python programmers Goal: Filter only the python programmers from the DATAlist using list comprehensions\nMethod 1: Use list comprehensions def run(): all_python_devs = [worker[\u0026#39;name\u0026#39;] for worker in DATA if worker[\u0026#39;language\u0026#39;] == \u0026#39;python\u0026#39;] for worker in all_python_devs: print(worker) if __name__ == \u0026#39;__main__\u0026#39;: run() Filter all the adults (age \u0026gt; 18 year) Goal: Filter all the adults workers from the DATAlist using filter and print their names\nFilter is a high order function in Python : filter and map Use lambda functions Method 1: Use filter (high order function) Using the filter()function requires lambda worker: worker['age'] \u0026gt; 18 ,DATA to extract the adults workers. However, doing the following code we are extracting all the dictionary from DATA. Therefore we will require the map()function to select only the names of the adult workers.\ndef run(): adults = list(filter(lambda worker: worker[\u0026#39;age\u0026#39;] \u0026gt; 18 ,DATA)) for worker in adults: print(worker) if __name__ == \u0026#39;__main__\u0026#39;: run() Method 2: User filter() + map() (high order functions) To achieve the goal we need to pass the filter() and map() functions to extract first all the dictionaries with the adult workers and second to extract the names of the adult workers.\ndef run(): adults = list(filter(lambda worker: worker[\u0026#39;age\u0026#39;] \u0026gt; 18 ,DATA)) adults = list(map(lambda worker: worker[\u0026#39;name\u0026#39;], DATA)) for worker in adults: print(worker) if __name__ == \u0026#39;__main__\u0026#39;: run() Filter old people (age \u0026gt; 70 ) Goal:\nCreate a new dictionary old_people with workers (age \u0026gt; 70 ) , but include the \u0026lsquo;old\u0026rsquo;:True or \u0026lsquo;old\u0026rsquo;: False into each worker dictionary. Method 1: Use map() When we apply the map() function by filtering with worker['age'] \u0026gt; 70we will have a list()with True and False value. Thus, we need to create the new dictionary\ndef run(): old_people = (list(map(lambda worker: worker[\u0026#39;age\u0026#39;] \u0026gt; 70, DATA))) for worker in old_people: print(worker) if __name__ == \u0026#39;__main__\u0026#39;: run() Method 2: Use map() + sum of dictionaries To add a new entry to the dictionary we will use the | command\nNote: This feature only works with python \u0026gt; 3.9\ndef run(): old_people = list(map(lambda worker: worker | {\u0026#39;old\u0026#39; : worker[\u0026#39;age\u0026#39;] \u0026gt; 70 }, DATA)) for worker in old_people: print(worker) if __name__ == \u0026#39;__main__\u0026#39;: run() Extra: Look about high order functions in YouTube This is an extra step, don\u0026rsquo;t jump this pass. Every time you learn a new concept practice some examples but remember if you want to secure your learning. You must integrate it to you workflow. The high order functions will simplify your list tasks for filtering data.\nIf you love this content, you can share a Cup of Coffee ! Your help is essential to continue with this project\n","permalink":"https://jesuscapistran.github.io/post/2022-07-02/","summary":"July 02, 2022 Filter data in python with high order functions This project (Platzi) is to learn How to filter data from a list of dictionaries. The goal is to use the python high order functions filter() and map() to achieve the task. Note: You will require python \u0026gt; v3.9 to finish the 100% of the examples. However if you have only python 3 you can achieve the 90%. Don\u0026rsquo;t worry, let\u0026rsquo;s practice.","title":"Filter data in python with high order functions"},{"content":"Once I load the Hugo Sitein my local machine. I proceed to configure it and to deploy the Public folder into Github. For this task I do a google search and find the following video tutorial:\n","permalink":"https://jesuscapistran.github.io/post/hugo_tutorial/","summary":"Once I load the Hugo Sitein my local machine. I proceed to configure it and to deploy the Public folder into Github. For this task I do a google search and find the following video tutorial:","title":"Deploy HUGO Blog in Github Pages"},{"content":"In this space I have the intention to store my notes related to my coding journey. The challenge of implementing Python into my scientific career comes after getting my Ph.D. degree. At that moment, I saw that all the data I had generated related to materials characterization (thin-films) were buried in my hard drive. Therefore, to overcome the lost of data I have to learn new skills for data management. : While I was looking for alternatives. I found that having a coding culture will be a solution because in this XXI century, DATA is the most valuable resource I will have. With this hyphothesis in my mind, I decide to challentge myself by learning Python and Git as the initial point of my joruney.\nWhy do you decide to learn Python?\n","permalink":"https://jesuscapistran.github.io/post/welcome_code_notes/","summary":"In this space I have the intention to store my notes related to my coding journey. The challenge of implementing Python into my scientific career comes after getting my Ph.D. degree. At that moment, I saw that all the data I had generated related to materials characterization (thin-films) were buried in my hard drive. Therefore, to overcome the lost of data I have to learn new skills for data management. : While I was looking for alternatives.","title":"My coding notes"}]