diff --git a/init.vim b/init.vim index f7385e0..969b886 100644 --- a/init.vim +++ b/init.vim @@ -31,6 +31,14 @@ Plug 'honza/vim-snippets' " Collection of Snippets, used by coc-snippet "Plug 'ludovicchabant/vim-gutentags', { 'for': ['js', 'vue', 'php', 'python'] } " Keep tags in sync Plug 'dpelle/vim-LanguageTool', { 'for': ['markdown', 'tex', 'plaintext', 'mail']} " LanguageTool bindings Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update +Plug 'nvim-treesitter/nvim-treesitter-textobjects' +Plug 'kyazdani42/nvim-web-devicons' " Icons... + +" telescope. Needed for octo.nvim, might replace fzf +Plug 'nvim-lua/popup.nvim' +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope.nvim' +Plug 'pwntester/octo.nvim' " {{{ CocPlugins Plug 'neoclide/coc-json', { 'do': 'yarn install --frozen-lockfile' } @@ -65,6 +73,7 @@ Plug 'jvanja/vim-bootstrap4-snippets', { 'for': ['html', 'blade'] } Plug 'gavocanov/vim-js-indent', { 'for': [ 'javascript' ]} " JavaScript indent support Plug 'heavenshell/vim-jsdoc', { 'for': [ 'javascript', 'typescript', 'vue' ], 'do': 'make install'} " Generate JSDoc comments Plug 'posva/vim-vue', { 'for': [ 'javascript', 'html', 'vue' ] } " vue.js integration +Plug 'kevinoid/vim-jsonc' "}}} " LaTeX{{{ @@ -238,6 +247,9 @@ let g:nv_search_paths = ['~/notes'] let g:nv_default_extension = '.md' let g:nv_main_directory = '~/notes' +" Octo.nvim +lua require('octo') + " ALE {{{ let g:airline#extensions#ale#enabled = 1 "}}} @@ -268,7 +280,7 @@ autocmd FileType c,cpp,objc vnoremap f :ClangFormat "}}} " Prettier -let g:prettier#config#tab_width = 2 +let g:prettier#config#tab_width = 4 let g:prettier#exec_cmd_async = 1 " Completion {{{ diff --git a/vim/ftplugin/javascript.vim b/vim/ftplugin/javascript.vim index 213f547..a99129f 100644 --- a/vim/ftplugin/javascript.vim +++ b/vim/ftplugin/javascript.vim @@ -25,8 +25,8 @@ let g:jsdoc_formatter = 'tsdoc' "autocmd bufwritepost *.js silent !standard --fix % setlocal wildignore+=node_modules -setlocal tabstop=2 -setlocal shiftwidth=2 +setlocal tabstop=4 +setlocal shiftwidth=4 " Create jsdoc with ,h nnoremap h :JsDoc diff --git a/vim/lua/octo.lua b/vim/lua/octo.lua new file mode 100644 index 0000000..fe84bd4 --- /dev/null +++ b/vim/lua/octo.lua @@ -0,0 +1,128 @@ +-- Config file for octo.nvim + +require"octo".setup({ + default_remote = {"upstream", "origin"}; -- order to try remotes + reaction_viewer_hint_icon = ""; -- marker for user reactions + user_icon = " "; -- user icon + timeline_marker = ""; -- timeline marker + timeline_indent = "2"; -- timeline indentation + right_bubble_delimiter = ""; -- Bubble delimiter + left_bubble_delimiter = ""; -- Bubble delimiter + github_hostname = ""; -- GitHub Enterprise host + snippet_context_lines = 4; -- number or lines around commented lines + file_panel = { + size = 10, -- changed files panel rows + use_icons = true -- use web-devicons in file panel + }, + mappings = { + issue = { + close_issue = "ic", -- close issue + reopen_issue = "io", -- reopen issue + list_issues = "il", -- list open issues on same repo + reload = "", -- reload issue + open_in_browser = "", -- open issue in browser + copy_url = "", -- copy url to system clipboard + add_assignee = "aa", -- add assignee + remove_assignee = "ad", -- remove assignee + create_label = "lc", -- create label + add_label = "la", -- add label + remove_label = "ld", -- remove label + goto_issue = "gi", -- navigate to a local repo issue + add_comment = "ca", -- add comment + delete_comment = "cd", -- delete comment + next_comment = "]c", -- go to next comment + prev_comment = "[c", -- go to previous comment + react_hooray = "rp", -- add/remove 🎉 reaction + react_heart = "rh", -- add/remove ❤️ reaction + react_eyes = "re", -- add/remove 👀 reaction + react_thumbs_up = "r+", -- add/remove 👍 reaction + react_thumbs_down = "r-", -- add/remove 👎 reaction + react_rocket = "rr", -- add/remove 🚀 reaction + react_laugh = "rl", -- add/remove 😄 reaction + react_confused = "rc", -- add/remove 😕 reaction + }, + pull_request = { + checkout_pr = "po", -- checkout PR + merge_pr = "pm", -- merge PR + list_commits = "pc", -- list PR commits + list_changed_files = "pf", -- list PR changed files + show_pr_diff = "pd", -- show PR diff + add_reviewer = "va", -- add reviewer + remove_reviewer = "vd", -- remove reviewer request + close_issue = "ic", -- close PR + reopen_issue = "io", -- reopen PR + list_issues = "il", -- list open issues on same repo + reload = "", -- reload PR + open_in_browser = "", -- open PR in browser + copy_url = "", -- copy url to system clipboard + add_assignee = "aa", -- add assignee + remove_assignee = "ad", -- remove assignee + create_label = "lc", -- create label + add_label = "la", -- add label + remove_label = "ld", -- remove label + goto_issue = "gi", -- navigate to a local repo issue + add_comment = "ca", -- add comment + delete_comment = "cd", -- delete comment + next_comment = "]c", -- go to next comment + prev_comment = "[c", -- go to previous comment + react_hooray = "rp", -- add/remove 🎉 reaction + react_heart = "rh", -- add/remove ❤️ reaction + react_eyes = "re", -- add/remove 👀 reaction + react_thumbs_up = "r+", -- add/remove 👍 reaction + react_thumbs_down = "r-", -- add/remove 👎 reaction + react_rocket = "rr", -- add/remove 🚀 reaction + react_laugh = "rl", -- add/remove 😄 reaction + react_confused = "rc", -- add/remove 😕 reaction + }, + review_thread = { + goto_issue = "gi", -- navigate to a local repo issue + add_comment = "ca", -- add comment + add_suggestion = "sa", -- add suggestion + delete_comment = "cd", -- delete comment + next_comment = "]c", -- go to next comment + prev_comment = "[c", -- go to previous comment + select_next_entry = "]q", -- move to previous changed file + select_prev_entry = "[q", -- move to next changed file + close_review_tab = "", -- close review tab + react_hooray = "rp", -- add/remove 🎉 reaction + react_heart = "rh", -- add/remove ❤️ reaction + react_eyes = "re", -- add/remove 👀 reaction + react_thumbs_up = "r+", -- add/remove 👍 reaction + react_thumbs_down = "r-", -- add/remove 👎 reaction + react_rocket = "rr", -- add/remove 🚀 reaction + react_laugh = "rl", -- add/remove 😄 reaction + react_confused = "rc", -- add/remove 😕 reaction + }, + submit_win = { + approve_review = "", -- approve review + comment_review = "", -- comment review + request_changes = "", -- request changes review + close_review_tab = "", -- close review tab + }, + review_diff = { + add_review_comment = "ca", -- add a new review comment + add_review_suggestion = "sa", -- add a new review suggestion + focus_files = "e", -- move focus to changed file panel + toggle_files = "b", -- hide/show changed files panel + next_thread = "]t", -- move to next thread + prev_thread = "[t", -- move to previous thread + select_next_entry = "]q", -- move to previous changed file + select_prev_entry = "[q", -- move to next changed file + close_review_tab = "", -- close review tab + toggle_viewed = "", -- toggle viewer viewed state + }, + file_panel = { + next_entry = "j", -- move to next changed file + prev_entry = "k", -- move to previous changed file + select_entry = "", -- show selected changed file diffs + refresh_files = "R", -- refresh changed files panel + focus_files = "e", -- move focus to changed file panel + toggle_files = "b", -- hide/show changed files panel + select_next_entry = "]q", -- move to previous changed file + select_prev_entry = "[q", -- move to next changed file + close_review_tab = "", -- close review tab + toggle_viewed = "", -- toggle viewer viewed state + } + } +}) + diff --git a/vim/lua/treesitter.textobj.lua b/vim/lua/treesitter.textobj.lua new file mode 100644 index 0000000..ce78766 --- /dev/null +++ b/vim/lua/treesitter.textobj.lua @@ -0,0 +1,26 @@ +require'nvim-treesitter.configs'.setup { + textobjects = { + select = { + enable = true, + + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + + -- Or you can define your own textobjects like this + --["iF"] = { + --python = "(function_definition) @function", + --cpp = "(function_definition) @function", + --c = "(function_definition) @function", + --java = "(method_declaration) @function", + --}, + }, + }, + }, +} diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index b7a526d..588ca0f 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -17,6 +17,7 @@ alias gc='git commit ' alias ga='git add ' alias gc1='git clone --depth 1 ' alias gco='git checkout ' +alias gpt='git push && git push --tags' #}}} alias mem='cd /dev/shm' @@ -24,6 +25,7 @@ alias svim='sudoedit ' alias down='http --download ' alias p3='python3 ' +alias py='/usr/bin/env python3 ' alias -g L='| less' alias -g G='| grep' diff --git a/zsh/custom-agnoster.zsh-theme b/zsh/custom-agnoster.zsh-theme index 159fc1a..058c3c9 100644 --- a/zsh/custom-agnoster.zsh-theme +++ b/zsh/custom-agnoster.zsh-theme @@ -29,6 +29,40 @@ # jobs are running in this shell will all be displayed automatically when # appropriate. + +##### prezto/prompt ###### + +# +# Prompt setup function commonly used by prompt themes. +# +# Authors: +# Sorin Ionescu +# + +prompt_pwd() { + +setopt localoptions extendedglob + +local current_pwd="${PWD/#$HOME/~}" +local ret_directory + +if [[ "$current_pwd" == (#m)[/~] ]]; then + ret_directory="$MATCH" + unset MATCH +elif zstyle -m ':prezto:module:prompt' pwd-length 'full'; then + ret_directory=${PWD} +elif zstyle -m ':prezto:module:prompt' pwd-length 'long'; then + ret_directory=${current_pwd} +else + ret_directory="${${${${(@j:/:M)${(@s:/:)current_pwd}##.#?}:h}%/}//\%/%%}/${${current_pwd:t}//\%/%%}" +fi + +unset current_pwd + +print "$ret_directory" +} +################################ + ### Segment drawing # A few utility functions to make it easy and re-usable to draw segmented prompts