Working toward code completion

This commit is contained in:
Nicole Tietz-Sokolskaya 2018-12-11 11:02:52 -05:00
parent a85df04e8f
commit 9b42dfb44f
5 changed files with 140 additions and 65 deletions

View file

@ -5,4 +5,5 @@ stow -t ~ vim
stow -t ~ iex
stow -t ~ tmux
stow -t ~ nvim
stow -t ~ ctags

61
ctags/.ctags Normal file
View file

@ -0,0 +1,61 @@
--exclude=.git
--exclude=.hg
--exclude=log
--exclude=tmp
--languages=-javascript,sql
--langdef=js
--langmap=js:.js
--langmap=js:+.jsx
--regex-js=/[ \t.]([A-Z][A-Z0-9._$]+)[ \t]*[=:][ \t]*([0-9"'\[\{]|null)/\1/n,constant/
--regex-js=/\.([A-Za-z0-9._$]+)[ \t]*=[ \t]*\{/\1/o,object/
--regex-js=/['"]*([A-Za-z0-9_$]+)['"]*[ \t]*:[ \t]*\{/\1/o,object/
--regex-js=/([A-Za-z0-9._$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*\{/\1\.\2/o,object/
--regex-js=/([A-Za-z0-9._$]+)[ \t]*=[ \t]*\(function\(\)/\1/c,class/
--regex-js=/['"]*([A-Za-z0-9_$]+)['"]*:[ \t]*\(function\(\)/\1/c,class/
--regex-js=/class[ \t]+([A-Za-z0-9._$]+)[ \t]*/\1/c,class/
--regex-js=/([A-Za-z$][A-Za-z0-9_$()]+)[ \t]*=[ \t]*[Rr]eact.createClass[ \t]*\(/\1/c,class/
--regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*=[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/
--regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*:[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/
--regex-js=/([A-Za-z$][A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\1/f,function/
--regex-js=/(function)*[ \t]*([A-Za-z$_][A-Za-z0-9_$]+)[ \t]*\([^)]*\)[ \t]*\{/\2/f,function/
--regex-js=/['"]*([A-Za-z$][A-Za-z0-9_$]+)['"]*:[ \t]*function[ \t]*\(/\1/m,method/
--regex-js=/([A-Za-z0-9_$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*function[ \t]*\(/\2/m,method/
--langdef=haskell
--langmap=haskell:.hs
--regex-haskell=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/
--regex-haskell=/^(new)?type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\2/t,type/
--regex-haskell=/^class[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/c,class/
--regex-haskell=/^data[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/d,data/
--regex-haskell=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/
--langdef=golang
--langmap=golang:.go
--regex-golang=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/
--regex-golang=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/
--regex-golang=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/
--langdef=typescript
--langmap=typescript:.ts
--langmap=typescript:+.tsx
--regex-typescript=/^[ \t]*(export)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\2/c,classes/
--regex-typescript=/^[ \t]*(export)?[ \t]*module[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/
--regex-typescript=/^[ \t]*(export)?[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\2/f,functions/
--regex-typescript=/^[ \t]*export[ \t]+var[ \t]+([a-zA-Z0-9_]+)/\1/v,variables/
--regex-typescript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\(\)/\1/v,varlambdas/
--regex-typescript=/^[ \t]*(export)?[ \t]*(public|private)[ \t]+(static)?[ \t]*([a-zA-Z0-9_]+)/\4/m,members/
--regex-typescript=/^[ \t]*(export)?[ \t]*interface[ \t]+([a-zA-Z0-9_]+)/\2/i,interfaces/
--regex-typescript=/^[ \t]*(export)?[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enums/
--regex-typescript=/^[ \t]*import[ \t]+([a-zA-Z0-9_]+)/\1/I,imports/
--langdef=elm
--langmap=elm:.elm
--regex-elm=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/
--regex-elm=/^type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\1/t,type/
--regex-elm=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/

View file

@ -1,100 +1,106 @@
#!/bin/bash
function install_utilities() {
sudo apt install vim neovim stow tmux htop
sudo apt install vim neovim stow tmux htop ctags
}
function install_docker() {
if [ -x "$(command -v docker)" ]; then
echo "Docker is already installed; skipping..."
return
fi
if [ -x "$(command -v docker)" ]; then
echo "Docker is already installed; skipping..."
return
fi
# install the prereqs
sudo apt install apt-transport-https ca-certificates curl software-properties-common
# install the prereqs
sudo apt install apt-transport-https ca-certificates curl software-properties-common
# add the docker key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# add the docker key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# add the docker repo and update apt
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
# add the docker repo and update apt
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
# install it
sudo apt install docker-ce
sudo usermod -aG docker ${USER}
# install it
sudo apt install docker-ce
sudo usermod -aG docker ${USER}
}
function install_docker_compose() {
if [ -x "$(command -v docker-compose)" ]; then
echo "Docker Compose is already installed; skipping..."
return
fi
if [ -x "$(command -v docker-compose)" ]; then
echo "Docker Compose is already installed; skipping..."
return
fi
# this makes me uncomfortable
sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# this makes me uncomfortable
sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
}
function install_yarn() {
if [ -x "$(command -v yarn)" ]; then
echo "yarn is already installed; skipping..."
return
fi
if [ -x "$(command -v yarn)" ]; then
echo "yarn is already installed; skipping..."
return
fi
# add the key
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# add the repo and update apt
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
# add the key
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# add the repo and update apt
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
sudo apt install yarn
}
function install_asdf() {
if [ -x "$(command -v asdf)" ]; then
echo "asdf is already installed; skipping..."
return
fi
if [ -x "$(command -v asdf)" ]; then
echo "asdf is already installed; skipping..."
return
fi
# install prereqs
sudo apt install automake libssl-dev autoconf libncurses5-dev
# install prereqs
sudo apt install automake libssl-dev autoconf libncurses5-dev
# install the tool
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.0
# install the tool
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.0
}
function install_google_cloud_sdk() {
if [ -x "$(command -v gsutil)" ]; then
echo "google cloud sdk is already installed; skipping..."
return
fi
if [ -x "$(command -v gsutil)" ]; then
echo "google cloud sdk is already installed; skipping..."
return
fi
# Create environment variable for correct distribution
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
# Create environment variable for correct distribution
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
# Add the Cloud SDK distribution URI as a package source
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
# Add the Cloud SDK distribution URI as a package source
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt update
sudo apt install google-cloud-sdk
sudo apt update
sudo apt install google-cloud-sdk
}
function install_pyenv() {
if [ -x "$(command -v pyenv)" ]; then
echo "pyenv is already installed; skipping..."
return
fi
if [ -x "$(command -v pyenv)" ]; then
echo "pyenv is already installed; skipping..."
return
fi
# install the prereqs
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
# install the prereqs
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
# we sure do love installing things from random scripts on github these days -_-
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
# we sure do love installing things from random scripts on github these days -_-
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
}
# Note: this must be run *after* pyenv is setup and in use
function setup_pynvim() {
pip3 install --user --upgrade pynvim
pip3 install --user --upgrade jedi
}
#install_utilities # TODO

View file

@ -52,3 +52,9 @@ set wildignore +=*/tmp/*,*.pyc,*/__pycache__/*
nmap <leader>b :Buffers<CR>
nmap <leader>f :Files<CR>
"let g:deoplete#enable_at_startup = 1
"let g:deoplete#disable_auto_complete = 1
"let g:deoplete#sources#jedi#show_docstring = 1
"inoremap <expr><C-n> deoplete#mappings#manual_complete()
"inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"

View file

@ -31,8 +31,9 @@ Plug 'editorconfig/editorconfig-vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } " fzf binary
Plug 'junegunn/fzf.vim' " fzf vim plugin
" Plug 'shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins', 'commit': '865747efe41ea1d923758617d71e8e5b59da292e' } " Auto-completion
" Auto-completion
" Plug 'shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Plug 'zchee/deoplete-jedi'
call plug#end()