20191010

Updated .vimrc: going back to vim from nvim

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'Shougo/deoplete.nvim', { 'do': 'UpdateRemotePlugins' }
Plugin 'jiangmiao/auto-pairs'
Plugin 'ervandew/supertab'
Plugin 'NLKNguyen/papercolor-theme'
Plugin 'itchyny/lightline.vim'
call vundle#end()            " required
filetype plugin indent on    " required

syntax on
set number
set tabstop=4
set autoindent
set shortmess+=I
set autochdir
set noswapfile
set nobackup
set noundofile
set showmatch
set expandtab
set shiftwidth=4
set laststatus=2
set noshowmode
set cursorline

"colorscheme 256_noir
" Change highlighting of cursor line when entering/leaving Insert Mode
"highlight CursorLine cterm=NONE ctermfg=NONE ctermbg=237 guifg=NONE guibg=#121212
"autocmd InsertEnter * highlight CursorLine cterm=NONE ctermfg=NONE ctermbg=234 guifg=NONE guibg=#1c1c1c
"autocmd InsertLeave * highlight CursorLine cterm=NONE ctermfg=NONE ctermbg=233 guifg=NONE guibg=#121212

set t_Co=256
colorscheme PaperColor
set background=dark

20190524

Trying out NeoVim, my init.vim

prep:
pip install pynvim && pip install neovim && pip install jedi && pip install yapf

install Plugin Manager
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

/.config/nvim/init.vim:
call plug#begin('~/.config/nvim/bundle')
Plug 'Shougo/deoplete.nvim', { 'do': 'UpdateRemotePlugins' }
Plug 'scrooloose/syntastic'
Plug 'bling/vim-airline'
Plug 'jiangmiao/auto-pairs'
Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}
Plug 'davidhalter/jedi-vim'
Plug 'ervandew/supertab'
call plug#end()

set number
syntax on
set tabstop=4
set autoindent
set showmatch
set expandtab
set shiftwidth=4

set background=dark
set cursorline
hi Cursorline term=bold cterm=bold ctermbg=DarkBlue
hi LineNr ctermfg=grey guifg=#2b506e guibg=#000000
hi CursorLineNr term=bold ctermfg=White gui=bold guifg=Yellow ctermbg=DarkBlue

noremap Y y$

autocmd FileType python nnoremap y :0,$!yapf
autocmd CompleteDone * pclose " To close preview window of deoplete automagically

20190408

updated .vimrc

inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O

set backspace=indent,eol,start
set number
syntax on
set tabstop=4
set autoindent

set cursorline
hi CursorLine term=bold cterm=bold ctermbg=DarkBlue
hi LineNr ctermfg=grey guifg=#2b506e guibg=#000000
hi CursorLineNr  term=bold ctermfg=Yellow gui=bold guifg=Yellow ctermbg=DarkBlue

set showmatch
set expandtab
set shiftwidth=4

20181123

20181016

Python + Virtualenv + VCcode


  1. Install user Python (~/Library/Python/3.x/bin)
  2. Update PATH in .bash_profile (source .bash_profile)
  3. Install virtualenv: pip install virtualenv
  4. Change dir to project folder (e.g. my_project_folder)
  5. Create virtualenv (e.g. virtualenv my_project)
  6. Activate (e.g. source my_project/bin/activate)
  7. Run VSCode on project folder (e.g. code my_project)
  8. Change python env (⇧⌘P) to my_project/bin/python
  9. Enjoy


20180510

Updated vimrc

set number
syntax on
set tabstop=4
set autoindent

set cursorline
hi CursorLine term=bold cterm=bold ctermbg=DarkBlue
hi LineNr ctermfg=grey guifg=#2b506e guibg=#000000
hi CursorLineNr  term=bold ctermfg=Yellow gui=bold guifg=Yellow ctermbg=DarkBlue

set showmatch
set expandtab
set shiftwidth=4

20180419

Sending JSON data via curl

curl -i -H "Content-Type: application/json" \
-X POST -d '{"name":"Zuck","type":"Snake"}' \
http://127.0.0.1:8080/animal

-X [DELETE|POST|GET]