Ver Fonte

separating deb and arch

logicp há 3 anos atrás
pai
commit
cec882c2cf

+ 0 - 0
README.md → arch/README.md


+ 0 - 0
hosts → arch/hosts


BIN
arch/packages.microsoft.gpg


+ 9 - 0
arch/roles/common/files/config.fish

@@ -0,0 +1,9 @@
+fish_vi_key_bindings
+
+alias ga "git add --all"
+alias gc "git commit"
+alias gd "git diff"
+alias gpo "git push origin "
+alias gpom "git push origin master"
+alias l "ls -l"
+alias f "fuck"

+ 332 - 0
arch/roles/common/files/init.vim

@@ -0,0 +1,332 @@
+" Inspired from https://github.com/kristijanhusak/neovim-config/blob/master/init.vim
+
+" ================ dein config ===================
+if &compatible
+  set nocompatible
+endif
+
+" Required:
+set runtimepath+=~/.local/share/dein/repos/github.com/Shougo/dein.vim
+
+" Required:
+if dein#load_state('~/.local/share/dein/')
+  call dein#begin('~/.local/share/dein/')
+
+  " Let dein manage dein
+  " Required:
+  call dein#add('~/.local/share/dein/repos/github.com/Shougo/dein.vim')
+
+  " >>> Add or remove your plugins here <<<:
+  ""
+  call dein#add('Shougo/deoplete.nvim')	" auto-complete
+  call dein#add('Shougo/denite.nvim') " fuzzy-searching across files using :Denite grep
+  call dein#add('Shougo/neosnippet.vim') " Include code snippets
+  call dein#add('Shougo/neosnippet-snippets')
+  call dein#add('honza/vim-snippets')
+
+  call dein#add('freeo/vim-kalisi') "colorscheme
+  call dein#add('ryanoasis/vim-devicons') " icons everywhere!
+  call dein#add('Raimondi/delimitMate') " Automatic closing of quotes, brackets, etc.
+
+  call dein#add('vim-airline/vim-airline') " action bar
+  call dein#add('vim-airline/vim-airline-themes')
+
+  call dein#add('tpope/vim-commentary') " Comment code easily
+  call dein#add('tpope/vim-surround') " Surround with quotes, brackets
+  call dein#add('tpope/vim-repeat') " Enable plugins to use repeat '.'
+
+  call dein#add('scrooloose/nerdtree') " File browser
+  call dein#add('Xuyuanp/nerdtree-git-plugin') " Git for nerdtree
+
+  call dein#add('airblade/vim-gitgutter') " Git diff viewer
+
+  call dein#add('duff/vim-bufonly') " Delete all buffers except current
+  call dein#add('gregsexton/MatchTag') " Match HTML tags
+  call dein#add('sheerun/vim-polyglot') " Language syntax,detect,indent,etc pack
+
+  call dein#add('mhinz/vim-startify') " A nice start screen
+  call dein#add('lambdalisue/gina.vim') " Git stuff
+
+  call dein#add('eugen0329/vim-esearch') " Search in files easily
+  call dein#add('posva/vim-vue') " Search in files easily
+
+  " You can specify revision/branch/tag.
+  " call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
+
+  " Required:
+  call dein#end()
+  call dein#save_state()
+endif
+
+" Required:
+filetype plugin indent on
+syntax enable
+
+" If you want to install not installed plugins on startup.
+if dein#check_install()
+  call dein#install()
+endif
+
+if (has("termguicolors"))
+ set termguicolors
+endif
+
+" ================ Plugin config =====================
+"
+
+let g:deoplete#enable_at_startup = 1
+
+let g:airline_powerline_fonts = 1                                               "Enable powerline fonts
+let g:airline_theme = "kalisi"                                                  "Set theme to powerline default theme
+let g:airline_section_y = '%{substitute(getcwd(), expand("$HOME"), "~", "g")}'  "Set relative path
+let g:airline#extensions#whitespace#enabled = 0                                 "Disable whitespace extension
+let g:airline#extensions#tabline#enabled = 1                                    "Enable tabline extension
+let g:airline#extensions#tabline#left_sep = ' '                                 "Left separator for tabline
+let g:airline#extensions#tabline#left_alt_sep = '│'                             "Right separator for tabline
+
+let g:delimitMate_expand_cr = 1                                                 "auto indent on enter
+
+let g:WebDevIconsNerdTreeAfterGlyphPadding = ' '                                "Set up spacing for sidebar icons
+
+let g:neosnippet#disable_runtime_snippets = {'_' : 1}                           "Snippets setup
+
+let g:gitgutter_realtime = 0                                                    "Disable gitgutter in realtime
+let g:gitgutter_eager = 0                                                       "Disable gitgutter to eager load on tab or buffer switch
+
+let g:NERDTreeChDirMode = 2                                                     "Always change the root directory
+let g:NERDTreeMinimalUI = 1                                                     "Disable help text and bookmark title
+let g:NERDTreeShowHidden = 1                                                    "Show hidden files in NERDTree
+let g:NERDTreeIgnore=['\.git$', '\.sass-cache$', '\.vagrant', '\.idea']
+
+let g:Tlist_Use_Right_Window = 1
+
+let g:neosnippet#snippets_directory = [
+            \ '~/.local/share/dein//repos/github.com//honza/vim-snippets/snippets',
+            \ '~/.local/share/dein/repos/github.com/Shougo/neosnippet-snippets/neosnippets',
+            \ '~/.local/my-snippets']
+
+" Use silver searcher for recursive file search
+call denite#custom#var('file_rec', 'command',
+	\ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
+
+" ================ General Config ====================
+
+let g:mapleader = ","                                                           "Change leader to a comma
+let g:enable_bold_font = 1                                                      "Enable bold font in colorscheme
+colorscheme kalisi
+
+set t_Co=256                                                                    "Set 256 colors
+set title                                                                       "change the terminal's title
+set relativenumber                                                              "relative numbers are good
+set history=500                                                                 "Store lots of :cmdline history
+set showcmd                                                                     "Show incomplete cmds down the bottom
+set noshowmode                                                                  "Hide showmode because of the powerline plugin
+set gdefault                                                                    "Set global flag for search and replace
+set gcr=a:blinkon500-blinkwait500-blinkoff500                                   "Set cursor blinking rate
+set cursorline                                                                  "Highlight current line
+set smartcase                                                                   "Smart case search if there is uppercase
+set ignorecase                                                                  "case insensitive search
+set mouse=a                                                                     "Enable mouse usage
+set showmatch                                                                   "Highlight matching bracket
+set nostartofline                                                               "Jump to first non-blank character
+set timeoutlen=1000 ttimeoutlen=200                                             "Reduce Command timeout for faster escape and O
+set fileencoding=utf-8                                                          "Set utf-8 encoding on write
+set wrap                                                                        "Enable word wrap
+set linebreak                                                                   "Wrap lines at convenient points
+set listchars=tab:\ \ ,trail:·                                                  "Set trails for tabs and spaces
+set list                                                                        "Enable listchars
+set lazyredraw                                                                  "Do not redraw on registers and macros
+set completeopt-=preview                                                        "Disable preview for autocomplete
+set background=dark                                                             "Set background to dark
+set conceallevel=2 concealcursor=i                                              "neosnippets conceal marker
+set splitright                                                                  "Set up new splits positions
+
+syntax on                                                                       "turn on syntax highlighting
+
+" ================ Persistent Undo ==================
+
+" Keep undo history across sessions, by storing in file.
+silent !mkdir ~/.config/nvim/backups > /dev/null 2>&1
+set undodir=~/.config/nvim/backups
+set undofile
+
+" ================ Indentation ======================
+
+set shiftwidth=4
+set softtabstop=4
+set tabstop=4
+set expandtab
+set smartindent
+set nofoldenable
+
+" ================ Completion =======================
+
+set wildmode=list:full
+set wildignore=*.o,*.obj,*~                                                     "stuff to ignore when tab completing
+set wildignore+=*vim/backups*
+set wildignore+=*sass-cache*
+set wildignore+=*cache*
+set wildignore+=*logs*
+set wildignore+=*node_modules/**
+set wildignore+=*DS_Store*
+set wildignore+=*.gem
+set wildignore+=log/**
+set wildignore+=tmp/**
+set wildignore+=*.png,*.jpg,*.gif
+
+" ================ Scrolling ========================
+
+set scrolloff=100                                                                 "Start scrolling when we're 100 lines away from margins
+set sidescrolloff=30
+set sidescroll=5
+
+
+" ================ Custom mappings ========================
+
+" Comment map
+nmap <Leader>c gcc
+" Line comment command
+xmap <Leader>c gc
+
+" Map save to Ctrl + S
+map <c-s> :w<CR>
+imap <c-s> <C-o>:w<CR>
+
+" Also save with ,w
+nnoremap <Leader>w :w<CR>
+
+" Easier window navigation
+nmap <C-h> <C-w>h
+nmap <C-j> <C-w>j
+nmap <C-k> <C-w>k
+nmap <C-l> <C-w>l
+
+" Down is really the next line
+nnoremap j gj
+nnoremap k gk
+
+" Expand snippets on tab if snippets exists, otherwise do autocompletion
+imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
+\ "\<Plug>(neosnippet_expand_or_jump)"
+\ : pumvisible() ? "\<C-n>" : "\<TAB>"
+
+" If popup window is visible do autocompletion from back
+imap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<S-Tab>"
+
+" Fix for jumping over placeholders for neosnippet
+smap <expr><TAB> neosnippet#jumpable() ?
+\ "\<Plug>(neosnippet_jump)"
+\: "\<TAB>"
+
+" Yank to the end of the line
+nnoremap Y y$
+
+" Copy to system clipboard
+vnoremap <C-c> "+y
+
+" Paste from system clipboard with Ctrl + v
+inoremap <C-v> <Esc>"+p
+nnoremap <Leader>p "0p
+vnoremap <Leader>p "0p
+
+" Move to the end of yanked text after yank and paste
+nnoremap p p`]
+vnoremap y y`]
+vnoremap p p`]
+
+" Move selected lines up and down
+vnoremap J :m '>+1<CR>gv=gv
+vnoremap K :m '<-2<CR>gv=gv
+
+" Clear search highlight
+nnoremap <Leader><space> :noh<CR>
+
+" Handle syntastic error window
+nnoremap <Leader>e :lopen<CR>
+nnoremap <Leader>q :lclose<CR>
+
+" Find current file in NERDTree
+nnoremap <Leader>hf :NERDTreeFind<CR>
+" Open NERDTree
+nnoremap <Leader>n :NERDTreeToggle<CR>
+
+" Toggle between last 2 buffers
+nnoremap <leader><tab> <c-^>
+
+" Auto change directory to match current file
+nnoremap <Leader>dc :cd %:p:h<CR>:pwd<CR>
+
+" Maps for indentation in normal mode
+nnoremap <tab> >>
+nnoremap <s-tab> <<
+
+" Indenting in visual mode
+xnoremap <s-tab> <gv
+xnoremap <tab> >gv
+
+" Resize window with shift + and shift -
+nnoremap + <c-w>5>
+nnoremap _ <c-w>5<
+
+" Center highlighted search
+nnoremap n nzz
+nnoremap N Nzz
+
+nnoremap <c-p> :Denite file_rec<CR>
+nnoremap <Leader>t :TlistToggle<CR>
+
+" Go to normal mode in terminal by pressing esc
+tnoremap <Esc> <C-\><C-n>
+
+" Always go at beginning of first word in line
+nnoremap 0 ^
+
+
+" ================ Abbreviations ====================
+
+cnoreabbrev Wq wq
+cnoreabbrev WQ wq
+cnoreabbrev W w
+cnoreabbrev Q q
+cnoreabbrev Qa qa
+cnoreabbrev Bd bd
+cnoreabbrev bD bd
+cnoreabbrev wrap set wrap
+cnoreabbrev nowrap set nowrap
+cnoreabbrev bda BufOnly
+cnoreabbrev t tabe
+cnoreabbrev T tabe
+cnoreabbrev den Denite
+
+" ================ Functions ========================
+function! s:StripTrailingWhitespaces()
+    let l:l = line(".")
+    let l:c = col(".")
+    %s/\s\+$//e
+    call cursor(l:l, l:c)
+endfunction
+
+function! s:LoadLocalVimrc()
+    if filereadable(glob(getcwd() . '/.vimrc.local'))
+        :execute 'source '.fnameescape(glob(getcwd(). '/.vimrc.local'))
+    endif
+endfunction
+
+" ================ Auto commands ======================
+
+augroup vimrc
+    autocmd!
+augroup END
+
+autocmd vimrc BufWritePre * :call s:StripTrailingWhitespaces()                  "Auto-remove trailing spaces
+autocmd vimrc InsertLeave * NeoSnippetClearMarkers                              "Remove unused markers for snippets
+autocmd vimrc InsertEnter * :set nocul                                          "Remove cursorline highlight
+autocmd vimrc InsertLeave * :set cul                                            "Add cursorline highlight in normal mode
+" autocmd vimrc FileType html,javascript,coffee,cucumber setlocal sw=2 sts=2 ts=2 "Set 2 indent for html
+" autocmd vimrc FileType php,javascript setlocal cc=80                            "Set right margin only for php and js
+autocmd vimrc VimEnter,BufNewFile,BufReadPost * call s:LoadLocalVimrc()         "Load per project vimrc (Used for custom test mappings, etc.)
+
+autocmd vimrc VimEnter * set vb t_vb=
+
+autocmd vimrc FileType nerdtree syntax match hideBracketsInNerdTree
+\ "\]" contained conceal containedin=ALL

+ 249 - 0
arch/roles/common/files/z.sh

@@ -0,0 +1,249 @@
+# Copyright (c) 2009 rupa deadwyler under the WTFPL license
+
+# maintains a jump-list of the directories you actually use
+#
+# INSTALL:
+#     * put something like this in your .bashrc/.zshrc:
+#         . /path/to/z.sh
+#     * cd around for a while to build up the db
+#     * PROFIT!!
+#     * optionally:
+#         set $_Z_CMD in .bashrc/.zshrc to change the command (default z).
+#         set $_Z_DATA in .bashrc/.zshrc to change the datafile (default ~/.z).
+#         set $_Z_NO_RESOLVE_SYMLINKS to prevent symlink resolution.
+#         set $_Z_NO_PROMPT_COMMAND if you're handling PROMPT_COMMAND yourself.
+#         set $_Z_EXCLUDE_DIRS to an array of directories to exclude.
+#         set $_Z_OWNER to your username if you want use z while sudo with $HOME kept
+#
+# USE:
+#     * z foo     # cd to most frecent dir matching foo
+#     * z foo bar # cd to most frecent dir matching foo and bar
+#     * z -r foo  # cd to highest ranked dir matching foo
+#     * z -t foo  # cd to most recently accessed dir matching foo
+#     * z -l foo  # list matches instead of cd
+#     * z -c foo  # restrict matches to subdirs of $PWD
+
+[ -d "${_Z_DATA:-$HOME/.z}" ] && {
+    echo "ERROR: z.sh's datafile (${_Z_DATA:-$HOME/.z}) is a directory."
+}
+
+_z() {
+
+    local datafile="${_Z_DATA:-$HOME/.z}"
+
+    # bail if we don't own ~/.z and $_Z_OWNER not set
+    [ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return
+
+    _z_dirs () {
+      while read line; do
+        # only count directories
+        [ -d "${line%%\|*}" ] && echo $line
+      done < "$datafile"
+      return 0
+    }
+
+    # add entries
+    if [ "$1" = "--add" ]; then
+        shift
+
+        # $HOME isn't worth matching
+        [ "$*" = "$HOME" ] && return
+
+        # don't track excluded directory trees
+        local exclude
+        for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
+            case "$*" in "$exclude*") return;; esac
+        done
+
+        # maintain the data file
+        local tempfile="$datafile.$RANDOM"
+        awk < <(_z_dirs 2>/dev/null) -v path="$*" -v now="$(date +%s)" -F"|" '
+            BEGIN {
+                rank[path] = 1
+                time[path] = now
+            }
+            $2 >= 1 {
+                # drop ranks below 1
+                if( $1 == path ) {
+                    rank[$1] = $2 + 1
+                    time[$1] = now
+                } else {
+                    rank[$1] = $2
+                    time[$1] = $3
+                }
+                count += $2
+            }
+            END {
+                if( count > 9000 ) {
+                    # aging
+                    for( x in rank ) print x "|" 0.99*rank[x] "|" time[x]
+                } else for( x in rank ) print x "|" rank[x] "|" time[x]
+            }
+        ' 2>/dev/null >| "$tempfile"
+        # do our best to avoid clobbering the datafile in a race condition.
+        if [ $? -ne 0 -a -f "$datafile" ]; then
+            env rm -f "$tempfile"
+        else
+            [ "$_Z_OWNER" ] && chown $_Z_OWNER:$(id -ng $_Z_OWNER) "$tempfile"
+            env mv -f "$tempfile" "$datafile" || env rm -f "$tempfile"
+        fi
+
+    # tab completion
+    elif [ "$1" = "--complete" -a -s "$datafile" ]; then
+        while read line; do
+            [ -d "${line%%\|*}" ] && echo $line
+        done < "$datafile" | awk -v q="$2" -F"|" '
+            BEGIN {
+                if( q == tolower(q) ) imatch = 1
+                q = substr(q, 3)
+                gsub(" ", ".*", q)
+            }
+            {
+                if( imatch ) {
+                    if( tolower($1) ~ tolower(q) ) print $1
+                } else if( $1 ~ q ) print $1
+            }
+        ' 2>/dev/null
+
+    else
+        # list/go
+        while [ "$1" ]; do case "$1" in
+            --) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;;
+            -*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
+                    c) local fnd="^$PWD $fnd";;
+                    e) local echo=echo;;
+                    h) echo "${_Z_CMD:-z} [-cehlrtx] args" >&2; return;;
+                    l) local list=1;;
+                    r) local typ="rank";;
+                    t) local typ="recent";;
+                    x) sed -i -e "\:^${PWD}|.*:d" "$datafile";;
+                esac; opt=${opt:1}; done;;
+             *) local fnd="$fnd${fnd:+ }$1";;
+        esac; local last=$1; [ "$#" -gt 0 ] && shift; done
+        [ "$fnd" -a "$fnd" != "^$PWD " ] || local list=1
+
+        # if we hit enter on a completion just go there
+        case "$last" in
+            # completions will always start with /
+            /*) [ -z "$list" -a -d "$last" ] && builtin cd "$last" && return;;
+        esac
+
+        # no file yet
+        [ -f "$datafile" ] || return
+
+        local cd
+        cd="$( < <( _z_dirs ) awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" '
+            function frecent(rank, time) {
+                # relate frequency and time
+                dx = t - time
+                if( dx < 3600 ) return rank * 4
+                if( dx < 86400 ) return rank * 2
+                if( dx < 604800 ) return rank / 2
+                return rank / 4
+            }
+            function output(files, out, common) {
+                # list or return the desired directory
+                if( list ) {
+                    cmd = "sort -n >&2"
+                    for( x in files ) {
+                        if( files[x] ) printf "%-10s %s\n", files[x], x | cmd
+                    }
+                    if( common ) {
+                        printf "%-10s %s\n", "common:", common > "/dev/stderr"
+                    }
+                } else {
+                    if( common ) out = common
+                    print out
+                }
+            }
+            function common(matches) {
+                # find the common root of a list of matches, if it exists
+                for( x in matches ) {
+                    if( matches[x] && (!short || length(x) < length(short)) ) {
+                        short = x
+                    }
+                }
+                if( short == "/" ) return
+                # use a copy to escape special characters, as we want to return
+                # the original. yeah, this escaping is awful.
+                clean_short = short
+                gsub(/\[\(\)\[\]\|\]/, "\\\\&", clean_short)
+                for( x in matches ) if( matches[x] && x !~ clean_short ) return
+                return short
+            }
+            BEGIN {
+                gsub(" ", ".*", q)
+                hi_rank = ihi_rank = -9999999999
+            }
+            {
+                if( typ == "rank" ) {
+                    rank = $2
+                } else if( typ == "recent" ) {
+                    rank = $3 - t
+                } else rank = frecent($2, $3)
+                if( $1 ~ q ) {
+                    matches[$1] = rank
+                } else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank
+                if( matches[$1] && matches[$1] > hi_rank ) {
+                    best_match = $1
+                    hi_rank = matches[$1]
+                } else if( imatches[$1] && imatches[$1] > ihi_rank ) {
+                    ibest_match = $1
+                    ihi_rank = imatches[$1]
+                }
+            }
+            END {
+                # prefer case sensitive
+                if( best_match ) {
+                    output(matches, best_match, common(matches))
+                } else if( ibest_match ) {
+                    output(imatches, ibest_match, common(imatches))
+                }
+            }
+        ')"
+
+        [ $? -eq 0 ] && [ "$cd" ] && {
+          if [ "$echo" ]; then echo "$cd"; else builtin cd "$cd"; fi
+        }
+    fi
+}
+
+alias ${_Z_CMD:-z}='_z 2>&1'
+
+[ "$_Z_NO_RESOLVE_SYMLINKS" ] || _Z_RESOLVE_SYMLINKS="-P"
+
+if type compctl >/dev/null 2>&1; then
+    # zsh
+    [ "$_Z_NO_PROMPT_COMMAND" ] || {
+        # populate directory list, avoid clobbering any other precmds.
+        if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
+            _z_precmd() {
+                (_z --add "${PWD:a}" &)
+            }
+        else
+            _z_precmd() {
+                (_z --add "${PWD:A}" &)
+            }
+        fi
+        [[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {
+            precmd_functions[$(($#precmd_functions+1))]=_z_precmd
+        }
+    }
+    _z_zsh_tab_completion() {
+        # tab completion
+        local compl
+        read -l compl
+        reply=(${(f)"$(_z --complete "$compl")"})
+    }
+    compctl -U -K _z_zsh_tab_completion _z
+elif type complete >/dev/null 2>&1; then
+    # bash
+    # tab completion
+    complete -o filenames -C '_z --complete "$COMP_LINE"' ${_Z_CMD:-z}
+    [ "$_Z_NO_PROMPT_COMMAND" ] || {
+        # populate directory list. avoid clobbering other PROMPT_COMMANDs.
+        grep "_z --add" <<< "$PROMPT_COMMAND" >/dev/null || {
+            PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''(_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null &);'
+        }
+    }
+fi

+ 123 - 0
arch/roles/common/tasks/main.yml

@@ -0,0 +1,123 @@
+---
+- name: install neovim
+  pacman: name=neovim state=present
+  tags: neovim
+  become: true
+
+- name: install neovim python client
+  pip: name=neovim
+  tags: python neovim
+  become: true
+
+- name: create vim symlink to nvim
+  file: src=/usr/bin/nvim dest=/usr/bin/vim state=link
+  become: true
+
+- name: create vi symlink to vim
+  file: src=/usr/bin/vim dest=/usr/bin/vi state=link
+  become: true
+
+- name: install zsh shell
+  pacman: name=zsh state=present
+  tags: zsh
+  become: true
+
+- name: switch default shell to fish
+  shell: chsh -s /usr/bin/zsh
+  tags: shellchange
+  become: true
+
+- name: clone oh-my-zsh
+  get_url:
+    url: https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
+    dest: /tmp/zsh_install.sh
+    mode: 0774
+
+- name: install oh-my-zsh
+  shell: /tmp/zsh_install.sh --noninteractive
+  ignore_errors: true
+  async: 10
+  poll: 1
+
+#- name: google chrome
+  #shell: |
+    #cd ~/Downloads && git clone https://aur.archlinux.org/google-chrome.git && cd google-chrome && makepkg -s
+ 
+- name: install google chrome
+  shell: cd /home/logicp/Downloads/google-chrome && pacman -U --noconfirm  google-chrome*.pkg.tar.xz
+  become: true
+  
+- name: neovim plug
+  shell: |
+    curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
+    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+
+- name: install nodejs
+  pacman: name=nodejs state=present
+  become: true
+
+- name: install npm
+  pacman: name=npm state=present
+  become: true
+
+- name: install virtualbox
+  pacman: name=virtualbox state=present
+  become: true
+
+- name: install vagrant
+  pacman: name=vagrant state=present
+  become: true
+
+- name: install ruby
+  pacman: name=ruby state=present
+  become: true
+
+- name: install ctags
+  pacman: name=ctags state=present
+  become: true
+
+- name: install locate
+  pacman: name=mlocate state=present
+  become: true
+
+- name: install yarn
+  shell: curl -o- -L https://yarnpkg.com/install.sh | bash
+  tags: yarn
+
+- name: Download VSCode
+  shell: wget -o /home/logicp/Downloads/vscode.tar.gz https://go.microsoft.com/fwlink/?LinkID=620884
+  tags: VSCode
+
+- name: Uncompress VSCode
+  shell: |
+      cd /home/logicp/Downloads && tar zxvf vscode.tar.gz
+
+- name: Install VSCode
+  shell: |
+      mv /home/logicp/Downloads/VSCode-linux-x64 /opt
+  become: true
+
+- name: Download IntelliJ Community
+  get_url:
+      url: http://
+      dest: /home/logicp/Downloads/intellij-ce.tar.gz
+
+- name: Unpack and Install IntelliJ
+  shell: |
+      tar zxvf /home/logicp/Downloads/intellij-ce.tar.gz || mv /home/logicp/Download/idea-IC* /opt/idea-IC
+  become: true
+
+- name: Clone and install slack
+  shell: |
+	cd /home/logicp/Downloads && git clone https://aur.archlinux.org/slack-desktop.git && \
+        cd slack-desktop && makepkg -s && pacman -U slack-desktop-*x86_64.pkg.tar.xz
+
+- name: Download Telegram
+  get_url:
+      url: https://github.com/telegramdesktop/tdesktop/releases/download/v1.7.8/tsetup.1.7.8.beta.tar.xz
+      dest: /home/logicp/Downloads/tsetup.xz
+
+- name: Unpack Telegram
+  shell: cd /home/logicp/Downloads && tar xvf tsetup.xz
+
+

BIN
arch/roles/packages.microsoft.gpg


+ 0 - 0
run.sh → arch/run.sh


+ 0 - 0
site.yml → arch/site.yml


+ 26 - 0
deb/README.md

@@ -0,0 +1,26 @@
+# Ansible-manjaro-desktop
+
+A playbook for setting up the tools I like on a fresh manjaro
+installation.
+
+## Setup
+
+1. Ansible must be installed
+
+>  sudo pacman -S ansible
+
+2. SSH server must be running
+
+```
+sudo pacman -S openssh
+sudo systemctl enable sshd
+sudo systemctl start sshd
+```
+
+3. SSH pass is required to enter password
+
+> sudo pacman -S sshpass
+
+## Running
+
+> ./run.sh

+ 2 - 0
deb/hosts

@@ -0,0 +1,2 @@
+[localhost]
+127.0.0.1 ansible_connection=local

BIN
deb/packages.microsoft.gpg


+ 9 - 0
deb/roles/common/files/config.fish

@@ -0,0 +1,9 @@
+fish_vi_key_bindings
+
+alias ga "git add --all"
+alias gc "git commit"
+alias gd "git diff"
+alias gpo "git push origin "
+alias gpom "git push origin master"
+alias l "ls -l"
+alias f "fuck"

+ 332 - 0
deb/roles/common/files/init.vim

@@ -0,0 +1,332 @@
+" Inspired from https://github.com/kristijanhusak/neovim-config/blob/master/init.vim
+
+" ================ dein config ===================
+if &compatible
+  set nocompatible
+endif
+
+" Required:
+set runtimepath+=~/.local/share/dein/repos/github.com/Shougo/dein.vim
+
+" Required:
+if dein#load_state('~/.local/share/dein/')
+  call dein#begin('~/.local/share/dein/')
+
+  " Let dein manage dein
+  " Required:
+  call dein#add('~/.local/share/dein/repos/github.com/Shougo/dein.vim')
+
+  " >>> Add or remove your plugins here <<<:
+  ""
+  call dein#add('Shougo/deoplete.nvim')	" auto-complete
+  call dein#add('Shougo/denite.nvim') " fuzzy-searching across files using :Denite grep
+  call dein#add('Shougo/neosnippet.vim') " Include code snippets
+  call dein#add('Shougo/neosnippet-snippets')
+  call dein#add('honza/vim-snippets')
+
+  call dein#add('freeo/vim-kalisi') "colorscheme
+  call dein#add('ryanoasis/vim-devicons') " icons everywhere!
+  call dein#add('Raimondi/delimitMate') " Automatic closing of quotes, brackets, etc.
+
+  call dein#add('vim-airline/vim-airline') " action bar
+  call dein#add('vim-airline/vim-airline-themes')
+
+  call dein#add('tpope/vim-commentary') " Comment code easily
+  call dein#add('tpope/vim-surround') " Surround with quotes, brackets
+  call dein#add('tpope/vim-repeat') " Enable plugins to use repeat '.'
+
+  call dein#add('scrooloose/nerdtree') " File browser
+  call dein#add('Xuyuanp/nerdtree-git-plugin') " Git for nerdtree
+
+  call dein#add('airblade/vim-gitgutter') " Git diff viewer
+
+  call dein#add('duff/vim-bufonly') " Delete all buffers except current
+  call dein#add('gregsexton/MatchTag') " Match HTML tags
+  call dein#add('sheerun/vim-polyglot') " Language syntax,detect,indent,etc pack
+
+  call dein#add('mhinz/vim-startify') " A nice start screen
+  call dein#add('lambdalisue/gina.vim') " Git stuff
+
+  call dein#add('eugen0329/vim-esearch') " Search in files easily
+  call dein#add('posva/vim-vue') " Search in files easily
+
+  " You can specify revision/branch/tag.
+  " call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
+
+  " Required:
+  call dein#end()
+  call dein#save_state()
+endif
+
+" Required:
+filetype plugin indent on
+syntax enable
+
+" If you want to install not installed plugins on startup.
+if dein#check_install()
+  call dein#install()
+endif
+
+if (has("termguicolors"))
+ set termguicolors
+endif
+
+" ================ Plugin config =====================
+"
+
+let g:deoplete#enable_at_startup = 1
+
+let g:airline_powerline_fonts = 1                                               "Enable powerline fonts
+let g:airline_theme = "kalisi"                                                  "Set theme to powerline default theme
+let g:airline_section_y = '%{substitute(getcwd(), expand("$HOME"), "~", "g")}'  "Set relative path
+let g:airline#extensions#whitespace#enabled = 0                                 "Disable whitespace extension
+let g:airline#extensions#tabline#enabled = 1                                    "Enable tabline extension
+let g:airline#extensions#tabline#left_sep = ' '                                 "Left separator for tabline
+let g:airline#extensions#tabline#left_alt_sep = '│'                             "Right separator for tabline
+
+let g:delimitMate_expand_cr = 1                                                 "auto indent on enter
+
+let g:WebDevIconsNerdTreeAfterGlyphPadding = ' '                                "Set up spacing for sidebar icons
+
+let g:neosnippet#disable_runtime_snippets = {'_' : 1}                           "Snippets setup
+
+let g:gitgutter_realtime = 0                                                    "Disable gitgutter in realtime
+let g:gitgutter_eager = 0                                                       "Disable gitgutter to eager load on tab or buffer switch
+
+let g:NERDTreeChDirMode = 2                                                     "Always change the root directory
+let g:NERDTreeMinimalUI = 1                                                     "Disable help text and bookmark title
+let g:NERDTreeShowHidden = 1                                                    "Show hidden files in NERDTree
+let g:NERDTreeIgnore=['\.git$', '\.sass-cache$', '\.vagrant', '\.idea']
+
+let g:Tlist_Use_Right_Window = 1
+
+let g:neosnippet#snippets_directory = [
+            \ '~/.local/share/dein//repos/github.com//honza/vim-snippets/snippets',
+            \ '~/.local/share/dein/repos/github.com/Shougo/neosnippet-snippets/neosnippets',
+            \ '~/.local/my-snippets']
+
+" Use silver searcher for recursive file search
+call denite#custom#var('file_rec', 'command',
+	\ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
+
+" ================ General Config ====================
+
+let g:mapleader = ","                                                           "Change leader to a comma
+let g:enable_bold_font = 1                                                      "Enable bold font in colorscheme
+colorscheme kalisi
+
+set t_Co=256                                                                    "Set 256 colors
+set title                                                                       "change the terminal's title
+set relativenumber                                                              "relative numbers are good
+set history=500                                                                 "Store lots of :cmdline history
+set showcmd                                                                     "Show incomplete cmds down the bottom
+set noshowmode                                                                  "Hide showmode because of the powerline plugin
+set gdefault                                                                    "Set global flag for search and replace
+set gcr=a:blinkon500-blinkwait500-blinkoff500                                   "Set cursor blinking rate
+set cursorline                                                                  "Highlight current line
+set smartcase                                                                   "Smart case search if there is uppercase
+set ignorecase                                                                  "case insensitive search
+set mouse=a                                                                     "Enable mouse usage
+set showmatch                                                                   "Highlight matching bracket
+set nostartofline                                                               "Jump to first non-blank character
+set timeoutlen=1000 ttimeoutlen=200                                             "Reduce Command timeout for faster escape and O
+set fileencoding=utf-8                                                          "Set utf-8 encoding on write
+set wrap                                                                        "Enable word wrap
+set linebreak                                                                   "Wrap lines at convenient points
+set listchars=tab:\ \ ,trail:·                                                  "Set trails for tabs and spaces
+set list                                                                        "Enable listchars
+set lazyredraw                                                                  "Do not redraw on registers and macros
+set completeopt-=preview                                                        "Disable preview for autocomplete
+set background=dark                                                             "Set background to dark
+set conceallevel=2 concealcursor=i                                              "neosnippets conceal marker
+set splitright                                                                  "Set up new splits positions
+
+syntax on                                                                       "turn on syntax highlighting
+
+" ================ Persistent Undo ==================
+
+" Keep undo history across sessions, by storing in file.
+silent !mkdir ~/.config/nvim/backups > /dev/null 2>&1
+set undodir=~/.config/nvim/backups
+set undofile
+
+" ================ Indentation ======================
+
+set shiftwidth=4
+set softtabstop=4
+set tabstop=4
+set expandtab
+set smartindent
+set nofoldenable
+
+" ================ Completion =======================
+
+set wildmode=list:full
+set wildignore=*.o,*.obj,*~                                                     "stuff to ignore when tab completing
+set wildignore+=*vim/backups*
+set wildignore+=*sass-cache*
+set wildignore+=*cache*
+set wildignore+=*logs*
+set wildignore+=*node_modules/**
+set wildignore+=*DS_Store*
+set wildignore+=*.gem
+set wildignore+=log/**
+set wildignore+=tmp/**
+set wildignore+=*.png,*.jpg,*.gif
+
+" ================ Scrolling ========================
+
+set scrolloff=100                                                                 "Start scrolling when we're 100 lines away from margins
+set sidescrolloff=30
+set sidescroll=5
+
+
+" ================ Custom mappings ========================
+
+" Comment map
+nmap <Leader>c gcc
+" Line comment command
+xmap <Leader>c gc
+
+" Map save to Ctrl + S
+map <c-s> :w<CR>
+imap <c-s> <C-o>:w<CR>
+
+" Also save with ,w
+nnoremap <Leader>w :w<CR>
+
+" Easier window navigation
+nmap <C-h> <C-w>h
+nmap <C-j> <C-w>j
+nmap <C-k> <C-w>k
+nmap <C-l> <C-w>l
+
+" Down is really the next line
+nnoremap j gj
+nnoremap k gk
+
+" Expand snippets on tab if snippets exists, otherwise do autocompletion
+imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
+\ "\<Plug>(neosnippet_expand_or_jump)"
+\ : pumvisible() ? "\<C-n>" : "\<TAB>"
+
+" If popup window is visible do autocompletion from back
+imap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<S-Tab>"
+
+" Fix for jumping over placeholders for neosnippet
+smap <expr><TAB> neosnippet#jumpable() ?
+\ "\<Plug>(neosnippet_jump)"
+\: "\<TAB>"
+
+" Yank to the end of the line
+nnoremap Y y$
+
+" Copy to system clipboard
+vnoremap <C-c> "+y
+
+" Paste from system clipboard with Ctrl + v
+inoremap <C-v> <Esc>"+p
+nnoremap <Leader>p "0p
+vnoremap <Leader>p "0p
+
+" Move to the end of yanked text after yank and paste
+nnoremap p p`]
+vnoremap y y`]
+vnoremap p p`]
+
+" Move selected lines up and down
+vnoremap J :m '>+1<CR>gv=gv
+vnoremap K :m '<-2<CR>gv=gv
+
+" Clear search highlight
+nnoremap <Leader><space> :noh<CR>
+
+" Handle syntastic error window
+nnoremap <Leader>e :lopen<CR>
+nnoremap <Leader>q :lclose<CR>
+
+" Find current file in NERDTree
+nnoremap <Leader>hf :NERDTreeFind<CR>
+" Open NERDTree
+nnoremap <Leader>n :NERDTreeToggle<CR>
+
+" Toggle between last 2 buffers
+nnoremap <leader><tab> <c-^>
+
+" Auto change directory to match current file
+nnoremap <Leader>dc :cd %:p:h<CR>:pwd<CR>
+
+" Maps for indentation in normal mode
+nnoremap <tab> >>
+nnoremap <s-tab> <<
+
+" Indenting in visual mode
+xnoremap <s-tab> <gv
+xnoremap <tab> >gv
+
+" Resize window with shift + and shift -
+nnoremap + <c-w>5>
+nnoremap _ <c-w>5<
+
+" Center highlighted search
+nnoremap n nzz
+nnoremap N Nzz
+
+nnoremap <c-p> :Denite file_rec<CR>
+nnoremap <Leader>t :TlistToggle<CR>
+
+" Go to normal mode in terminal by pressing esc
+tnoremap <Esc> <C-\><C-n>
+
+" Always go at beginning of first word in line
+nnoremap 0 ^
+
+
+" ================ Abbreviations ====================
+
+cnoreabbrev Wq wq
+cnoreabbrev WQ wq
+cnoreabbrev W w
+cnoreabbrev Q q
+cnoreabbrev Qa qa
+cnoreabbrev Bd bd
+cnoreabbrev bD bd
+cnoreabbrev wrap set wrap
+cnoreabbrev nowrap set nowrap
+cnoreabbrev bda BufOnly
+cnoreabbrev t tabe
+cnoreabbrev T tabe
+cnoreabbrev den Denite
+
+" ================ Functions ========================
+function! s:StripTrailingWhitespaces()
+    let l:l = line(".")
+    let l:c = col(".")
+    %s/\s\+$//e
+    call cursor(l:l, l:c)
+endfunction
+
+function! s:LoadLocalVimrc()
+    if filereadable(glob(getcwd() . '/.vimrc.local'))
+        :execute 'source '.fnameescape(glob(getcwd(). '/.vimrc.local'))
+    endif
+endfunction
+
+" ================ Auto commands ======================
+
+augroup vimrc
+    autocmd!
+augroup END
+
+autocmd vimrc BufWritePre * :call s:StripTrailingWhitespaces()                  "Auto-remove trailing spaces
+autocmd vimrc InsertLeave * NeoSnippetClearMarkers                              "Remove unused markers for snippets
+autocmd vimrc InsertEnter * :set nocul                                          "Remove cursorline highlight
+autocmd vimrc InsertLeave * :set cul                                            "Add cursorline highlight in normal mode
+" autocmd vimrc FileType html,javascript,coffee,cucumber setlocal sw=2 sts=2 ts=2 "Set 2 indent for html
+" autocmd vimrc FileType php,javascript setlocal cc=80                            "Set right margin only for php and js
+autocmd vimrc VimEnter,BufNewFile,BufReadPost * call s:LoadLocalVimrc()         "Load per project vimrc (Used for custom test mappings, etc.)
+
+autocmd vimrc VimEnter * set vb t_vb=
+
+autocmd vimrc FileType nerdtree syntax match hideBracketsInNerdTree
+\ "\]" contained conceal containedin=ALL

+ 249 - 0
deb/roles/common/files/z.sh

@@ -0,0 +1,249 @@
+# Copyright (c) 2009 rupa deadwyler under the WTFPL license
+
+# maintains a jump-list of the directories you actually use
+#
+# INSTALL:
+#     * put something like this in your .bashrc/.zshrc:
+#         . /path/to/z.sh
+#     * cd around for a while to build up the db
+#     * PROFIT!!
+#     * optionally:
+#         set $_Z_CMD in .bashrc/.zshrc to change the command (default z).
+#         set $_Z_DATA in .bashrc/.zshrc to change the datafile (default ~/.z).
+#         set $_Z_NO_RESOLVE_SYMLINKS to prevent symlink resolution.
+#         set $_Z_NO_PROMPT_COMMAND if you're handling PROMPT_COMMAND yourself.
+#         set $_Z_EXCLUDE_DIRS to an array of directories to exclude.
+#         set $_Z_OWNER to your username if you want use z while sudo with $HOME kept
+#
+# USE:
+#     * z foo     # cd to most frecent dir matching foo
+#     * z foo bar # cd to most frecent dir matching foo and bar
+#     * z -r foo  # cd to highest ranked dir matching foo
+#     * z -t foo  # cd to most recently accessed dir matching foo
+#     * z -l foo  # list matches instead of cd
+#     * z -c foo  # restrict matches to subdirs of $PWD
+
+[ -d "${_Z_DATA:-$HOME/.z}" ] && {
+    echo "ERROR: z.sh's datafile (${_Z_DATA:-$HOME/.z}) is a directory."
+}
+
+_z() {
+
+    local datafile="${_Z_DATA:-$HOME/.z}"
+
+    # bail if we don't own ~/.z and $_Z_OWNER not set
+    [ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return
+
+    _z_dirs () {
+      while read line; do
+        # only count directories
+        [ -d "${line%%\|*}" ] && echo $line
+      done < "$datafile"
+      return 0
+    }
+
+    # add entries
+    if [ "$1" = "--add" ]; then
+        shift
+
+        # $HOME isn't worth matching
+        [ "$*" = "$HOME" ] && return
+
+        # don't track excluded directory trees
+        local exclude
+        for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
+            case "$*" in "$exclude*") return;; esac
+        done
+
+        # maintain the data file
+        local tempfile="$datafile.$RANDOM"
+        awk < <(_z_dirs 2>/dev/null) -v path="$*" -v now="$(date +%s)" -F"|" '
+            BEGIN {
+                rank[path] = 1
+                time[path] = now
+            }
+            $2 >= 1 {
+                # drop ranks below 1
+                if( $1 == path ) {
+                    rank[$1] = $2 + 1
+                    time[$1] = now
+                } else {
+                    rank[$1] = $2
+                    time[$1] = $3
+                }
+                count += $2
+            }
+            END {
+                if( count > 9000 ) {
+                    # aging
+                    for( x in rank ) print x "|" 0.99*rank[x] "|" time[x]
+                } else for( x in rank ) print x "|" rank[x] "|" time[x]
+            }
+        ' 2>/dev/null >| "$tempfile"
+        # do our best to avoid clobbering the datafile in a race condition.
+        if [ $? -ne 0 -a -f "$datafile" ]; then
+            env rm -f "$tempfile"
+        else
+            [ "$_Z_OWNER" ] && chown $_Z_OWNER:$(id -ng $_Z_OWNER) "$tempfile"
+            env mv -f "$tempfile" "$datafile" || env rm -f "$tempfile"
+        fi
+
+    # tab completion
+    elif [ "$1" = "--complete" -a -s "$datafile" ]; then
+        while read line; do
+            [ -d "${line%%\|*}" ] && echo $line
+        done < "$datafile" | awk -v q="$2" -F"|" '
+            BEGIN {
+                if( q == tolower(q) ) imatch = 1
+                q = substr(q, 3)
+                gsub(" ", ".*", q)
+            }
+            {
+                if( imatch ) {
+                    if( tolower($1) ~ tolower(q) ) print $1
+                } else if( $1 ~ q ) print $1
+            }
+        ' 2>/dev/null
+
+    else
+        # list/go
+        while [ "$1" ]; do case "$1" in
+            --) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;;
+            -*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
+                    c) local fnd="^$PWD $fnd";;
+                    e) local echo=echo;;
+                    h) echo "${_Z_CMD:-z} [-cehlrtx] args" >&2; return;;
+                    l) local list=1;;
+                    r) local typ="rank";;
+                    t) local typ="recent";;
+                    x) sed -i -e "\:^${PWD}|.*:d" "$datafile";;
+                esac; opt=${opt:1}; done;;
+             *) local fnd="$fnd${fnd:+ }$1";;
+        esac; local last=$1; [ "$#" -gt 0 ] && shift; done
+        [ "$fnd" -a "$fnd" != "^$PWD " ] || local list=1
+
+        # if we hit enter on a completion just go there
+        case "$last" in
+            # completions will always start with /
+            /*) [ -z "$list" -a -d "$last" ] && builtin cd "$last" && return;;
+        esac
+
+        # no file yet
+        [ -f "$datafile" ] || return
+
+        local cd
+        cd="$( < <( _z_dirs ) awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" '
+            function frecent(rank, time) {
+                # relate frequency and time
+                dx = t - time
+                if( dx < 3600 ) return rank * 4
+                if( dx < 86400 ) return rank * 2
+                if( dx < 604800 ) return rank / 2
+                return rank / 4
+            }
+            function output(files, out, common) {
+                # list or return the desired directory
+                if( list ) {
+                    cmd = "sort -n >&2"
+                    for( x in files ) {
+                        if( files[x] ) printf "%-10s %s\n", files[x], x | cmd
+                    }
+                    if( common ) {
+                        printf "%-10s %s\n", "common:", common > "/dev/stderr"
+                    }
+                } else {
+                    if( common ) out = common
+                    print out
+                }
+            }
+            function common(matches) {
+                # find the common root of a list of matches, if it exists
+                for( x in matches ) {
+                    if( matches[x] && (!short || length(x) < length(short)) ) {
+                        short = x
+                    }
+                }
+                if( short == "/" ) return
+                # use a copy to escape special characters, as we want to return
+                # the original. yeah, this escaping is awful.
+                clean_short = short
+                gsub(/\[\(\)\[\]\|\]/, "\\\\&", clean_short)
+                for( x in matches ) if( matches[x] && x !~ clean_short ) return
+                return short
+            }
+            BEGIN {
+                gsub(" ", ".*", q)
+                hi_rank = ihi_rank = -9999999999
+            }
+            {
+                if( typ == "rank" ) {
+                    rank = $2
+                } else if( typ == "recent" ) {
+                    rank = $3 - t
+                } else rank = frecent($2, $3)
+                if( $1 ~ q ) {
+                    matches[$1] = rank
+                } else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank
+                if( matches[$1] && matches[$1] > hi_rank ) {
+                    best_match = $1
+                    hi_rank = matches[$1]
+                } else if( imatches[$1] && imatches[$1] > ihi_rank ) {
+                    ibest_match = $1
+                    ihi_rank = imatches[$1]
+                }
+            }
+            END {
+                # prefer case sensitive
+                if( best_match ) {
+                    output(matches, best_match, common(matches))
+                } else if( ibest_match ) {
+                    output(imatches, ibest_match, common(imatches))
+                }
+            }
+        ')"
+
+        [ $? -eq 0 ] && [ "$cd" ] && {
+          if [ "$echo" ]; then echo "$cd"; else builtin cd "$cd"; fi
+        }
+    fi
+}
+
+alias ${_Z_CMD:-z}='_z 2>&1'
+
+[ "$_Z_NO_RESOLVE_SYMLINKS" ] || _Z_RESOLVE_SYMLINKS="-P"
+
+if type compctl >/dev/null 2>&1; then
+    # zsh
+    [ "$_Z_NO_PROMPT_COMMAND" ] || {
+        # populate directory list, avoid clobbering any other precmds.
+        if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
+            _z_precmd() {
+                (_z --add "${PWD:a}" &)
+            }
+        else
+            _z_precmd() {
+                (_z --add "${PWD:A}" &)
+            }
+        fi
+        [[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {
+            precmd_functions[$(($#precmd_functions+1))]=_z_precmd
+        }
+    }
+    _z_zsh_tab_completion() {
+        # tab completion
+        local compl
+        read -l compl
+        reply=(${(f)"$(_z --complete "$compl")"})
+    }
+    compctl -U -K _z_zsh_tab_completion _z
+elif type complete >/dev/null 2>&1; then
+    # bash
+    # tab completion
+    complete -o filenames -C '_z --complete "$COMP_LINE"' ${_Z_CMD:-z}
+    [ "$_Z_NO_PROMPT_COMMAND" ] || {
+        # populate directory list. avoid clobbering other PROMPT_COMMANDs.
+        grep "_z --add" <<< "$PROMPT_COMMAND" >/dev/null || {
+            PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''(_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null &);'
+        }
+    }
+fi

+ 94 - 0
deb/roles/common/tasks/main.yml

@@ -0,0 +1,94 @@
+- name: install neovim
+  apt: name=neovim state=present
+  tags: neovim
+  become: true
+
+- name: create vim symlink to nvim
+  file: src=/usr/bin/nvim dest=/usr/bin/vim state=link
+  become: true
+
+- name: create vi symlink to vim
+  file: src=/usr/bin/vim dest=/usr/bin/vi state=link
+  become: true
+
+- name: install zsh shell
+  apt: name=zsh state=present
+  tags: zsh
+  become: true
+
+- name: switch default shell to zsh
+  shell: chsh -s /usr/bin/zsh
+  tags: shellchange
+  become: true
+
+#- name: clone oh-my-zsh
+  #get_url:
+    #url: https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
+    #dest: /tmp/zsh_install.sh
+    #mode: 0774
+
+#- name: install oh-my-zsh
+  #shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
+
+#- name: neovim plug
+  #shell: sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
+       #https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
+
+- name: install postgres
+  apt: name=postgresql state=present
+  become: true
+
+- name: install libpq
+  apt: name=libpq-dev state=present
+  become: true
+
+- name: install libpqxx
+  apt: name=libpqxx-dev state=present
+  become: true
+
+- name: install cmake
+  apt: name=cmake state=present
+  become: true
+  
+- name: libpqxx
+  shell: |
+    mkdir /tmp/libpqxx
+    cd /tmp/libpqxx
+    git clone https://github.com/jtv/libpqxx
+    cd libpqxx
+    
+  
+- name: add yarn
+  shell: |
+    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
+    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
+    sudo apt update && sudo apt install --no-install-recommends yarn
+  become: true
+  
+- name: add nvm
+  shell: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
+
+
+#- name: add vscode repo
+  #shell: wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg && sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ &&  sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
+  #become: true
+  
+#- name: install vscode
+  #shell: sudo apt-get install -y code
+  #become: true
+  
+#- name: build tools
+  #apt: build-essential libgl1-mesa-dev
+  #become: true
+
+#- name: qt
+  #apt: qt5-default
+  #become: true
+
+#- name: download telegram
+  #shell: |
+    #wget -O- https://telegram.org/dl/desktop/linux | sudo tar xJ -C /opt/
+
+#- name: link telegram
+  #shell: |
+    #sudo ln -s /opt/Telegram/Telegram /usr/local/bin/telegram-desktop

BIN
deb/roles/packages.microsoft.gpg


+ 2 - 0
deb/run.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+ansible-playbook -i hosts site.yml --ask-become-pass  

+ 7 - 0
deb/site.yml

@@ -0,0 +1,7 @@
+---
+- name: install software
+  hosts: localhost
+  remote_user: logicp
+
+  roles:
+    - common

BIN
roles/packages.microsoft.gpg