Browse Source

update

master
Schneider 3 years ago
parent
commit
18e7356292
Signed by: schneider GPG Key ID: 3F50B02A50039F3B
  1. 14
      init.vim
  2. 4
      vim/ftplugin/javascript.vim
  3. 128
      vim/lua/octo.lua
  4. 26
      vim/lua/treesitter.textobj.lua
  5. 2
      zsh/aliases.zsh
  6. 34
      zsh/custom-agnoster.zsh-theme

14
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 <buffer><Leader>f :ClangFormat<CR>
"}}}
" Prettier
let g:prettier#config#tab_width = 2
let g:prettier#config#tab_width = 4
let g:prettier#exec_cmd_async = 1
" Completion {{{

4
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 <leader>h :JsDoc<CR>

128
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 = "<space>ic", -- close issue
reopen_issue = "<space>io", -- reopen issue
list_issues = "<space>il", -- list open issues on same repo
reload = "<C-r>", -- reload issue
open_in_browser = "<C-b>", -- open issue in browser
copy_url = "<C-y>", -- copy url to system clipboard
add_assignee = "<space>aa", -- add assignee
remove_assignee = "<space>ad", -- remove assignee
create_label = "<space>lc", -- create label
add_label = "<space>la", -- add label
remove_label = "<space>ld", -- remove label
goto_issue = "<space>gi", -- navigate to a local repo issue
add_comment = "<space>ca", -- add comment
delete_comment = "<space>cd", -- delete comment
next_comment = "]c", -- go to next comment
prev_comment = "[c", -- go to previous comment
react_hooray = "<space>rp", -- add/remove 🎉 reaction
react_heart = "<space>rh", -- add/remove ❤️ reaction
react_eyes = "<space>re", -- add/remove 👀 reaction
react_thumbs_up = "<space>r+", -- add/remove 👍 reaction
react_thumbs_down = "<space>r-", -- add/remove 👎 reaction
react_rocket = "<space>rr", -- add/remove 🚀 reaction
react_laugh = "<space>rl", -- add/remove 😄 reaction
react_confused = "<space>rc", -- add/remove 😕 reaction
},
pull_request = {
checkout_pr = "<space>po", -- checkout PR
merge_pr = "<space>pm", -- merge PR
list_commits = "<space>pc", -- list PR commits
list_changed_files = "<space>pf", -- list PR changed files
show_pr_diff = "<space>pd", -- show PR diff
add_reviewer = "<space>va", -- add reviewer
remove_reviewer = "<space>vd", -- remove reviewer request
close_issue = "<space>ic", -- close PR
reopen_issue = "<space>io", -- reopen PR
list_issues = "<space>il", -- list open issues on same repo
reload = "<C-r>", -- reload PR
open_in_browser = "<C-b>", -- open PR in browser
copy_url = "<C-y>", -- copy url to system clipboard
add_assignee = "<space>aa", -- add assignee
remove_assignee = "<space>ad", -- remove assignee
create_label = "<space>lc", -- create label
add_label = "<space>la", -- add label
remove_label = "<space>ld", -- remove label
goto_issue = "<space>gi", -- navigate to a local repo issue
add_comment = "<space>ca", -- add comment
delete_comment = "<space>cd", -- delete comment
next_comment = "]c", -- go to next comment
prev_comment = "[c", -- go to previous comment
react_hooray = "<space>rp", -- add/remove 🎉 reaction
react_heart = "<space>rh", -- add/remove ❤️ reaction
react_eyes = "<space>re", -- add/remove 👀 reaction
react_thumbs_up = "<space>r+", -- add/remove 👍 reaction
react_thumbs_down = "<space>r-", -- add/remove 👎 reaction
react_rocket = "<space>rr", -- add/remove 🚀 reaction
react_laugh = "<space>rl", -- add/remove 😄 reaction
react_confused = "<space>rc", -- add/remove 😕 reaction
},
review_thread = {
goto_issue = "<space>gi", -- navigate to a local repo issue
add_comment = "<space>ca", -- add comment
add_suggestion = "<space>sa", -- add suggestion
delete_comment = "<space>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 = "<C-c>", -- close review tab
react_hooray = "<space>rp", -- add/remove 🎉 reaction
react_heart = "<space>rh", -- add/remove ❤️ reaction
react_eyes = "<space>re", -- add/remove 👀 reaction
react_thumbs_up = "<space>r+", -- add/remove 👍 reaction
react_thumbs_down = "<space>r-", -- add/remove 👎 reaction
react_rocket = "<space>rr", -- add/remove 🚀 reaction
react_laugh = "<space>rl", -- add/remove 😄 reaction
react_confused = "<space>rc", -- add/remove 😕 reaction
},
submit_win = {
approve_review = "<C-a>", -- approve review
comment_review = "<C-m>", -- comment review
request_changes = "<C-r>", -- request changes review
close_review_tab = "<C-c>", -- close review tab
},
review_diff = {
add_review_comment = "<space>ca", -- add a new review comment
add_review_suggestion = "<space>sa", -- add a new review suggestion
focus_files = "<leader>e", -- move focus to changed file panel
toggle_files = "<leader>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 = "<C-c>", -- close review tab
toggle_viewed = "<leader><space>", -- toggle viewer viewed state
},
file_panel = {
next_entry = "j", -- move to next changed file
prev_entry = "k", -- move to previous changed file
select_entry = "<cr>", -- show selected changed file diffs
refresh_files = "R", -- refresh changed files panel
focus_files = "<leader>e", -- move focus to changed file panel
toggle_files = "<leader>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 = "<C-c>", -- close review tab
toggle_viewed = "<leader><space>", -- toggle viewer viewed state
}
}
})

26
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",
--},
},
},
},
}

2
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'

34
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 <sorin.ionescu@gmail.com>
#
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

Loading…
Cancel
Save