summaryrefslogtreecommitdiff
path: root/config/vim
diff options
context:
space:
mode:
Diffstat (limited to 'config/vim')
-rw-r--r--config/vim/autoload/rainbow_parentheses.vim98
-rw-r--r--config/vim/plugin/pickachu.vim45
-rw-r--r--config/vim/plugin/pickachu/__init__.py0
-rw-r--r--config/vim/plugin/pickachu/__pycache__/__init__.cpython-39.pycbin142 -> 0 bytes
-rw-r--r--config/vim/plugin/pickachu/__pycache__/apps.cpython-39.pycbin1107 -> 0 bytes
-rw-r--r--config/vim/plugin/pickachu/__pycache__/main.cpython-39.pycbin719 -> 0 bytes
-rw-r--r--config/vim/plugin/pickachu/__pycache__/processors.cpython-39.pycbin1896 -> 0 bytes
-rw-r--r--config/vim/plugin/pickachu/apps.py68
-rw-r--r--config/vim/plugin/pickachu/main.py36
-rw-r--r--config/vim/plugin/pickachu/processors.py80
-rw-r--r--config/vim/plugin/rainbow_parentheses.vim13
-rw-r--r--config/vim/vimrc2
12 files changed, 1 insertions, 341 deletions
diff --git a/config/vim/autoload/rainbow_parentheses.vim b/config/vim/autoload/rainbow_parentheses.vim
deleted file mode 100644
index 87a74ad..0000000
--- a/config/vim/autoload/rainbow_parentheses.vim
+++ /dev/null
@@ -1,98 +0,0 @@
-"==============================================================================
-" Description: Rainbow colors for parentheses, based on rainbow_parenthsis.vim
-" by Martin Krischik and others.
-" 2011-10-12: Use less code. Leave room for deeper levels.
-"==============================================================================
-
-let s:pairs = [
- \ ['brown', 'RoyalBlue3'],
- \ ['Darkblue', 'SeaGreen3'],
- \ ['darkgray', 'DarkOrchid3'],
- \ ['darkgreen', 'firebrick3'],
- \ ['darkcyan', 'RoyalBlue3'],
- \ ['darkred', 'SeaGreen3'],
- \ ['darkmagenta', 'DarkOrchid3'],
- \ ['brown', 'firebrick3'],
- \ ['gray', 'RoyalBlue3'],
- \ ['black', 'SeaGreen3'],
- \ ['darkmagenta', 'DarkOrchid3'],
- \ ['Darkblue', 'firebrick3'],
- \ ['darkgreen', 'RoyalBlue3'],
- \ ['darkcyan', 'SeaGreen3'],
- \ ['darkred', 'DarkOrchid3'],
- \ ['red', 'firebrick3'],
- \ ]
-let s:pairs = exists('g:rbpt_colorpairs') ? g:rbpt_colorpairs : s:pairs
-let s:max = exists('g:rbpt_max') ? g:rbpt_max : max([len(s:pairs), 16])
-let s:loadtgl = exists('g:rbpt_loadcmd_toggle') ? g:rbpt_loadcmd_toggle : 0
-let s:types = [['(',')'],['\[','\]'],['{','}'],['<','>']]
-
-func! s:extend()
- if s:max > len(s:pairs)
- cal extend(s:pairs, s:pairs)
- cal s:extend()
- elseif s:max < len(s:pairs)
- cal remove(s:pairs, s:max, -1)
- endif
-endfunc
-cal s:extend()
-
-func! rainbow_parentheses#activate()
- let [id, s:active] = [1, 1]
- for [ctermfg, guifg] in s:pairs
- exe 'hi default level'.id.'c ctermfg='.ctermfg.' guifg='.guifg
- let id += 1
- endfor
-endfunc
-
-func! rainbow_parentheses#clear()
- for each in range(1, s:max)
- exe 'hi clear level'.each.'c'
- endfor
- let s:active = 0
-endfunc
-
-func! rainbow_parentheses#toggle()
- if !exists('s:active')
- cal rainbow_parentheses#load(0)
- endif
- let afunc = exists('s:active') && s:active ? 'clear' : 'activate'
- cal call('rainbow_parentheses#'.afunc, [])
-endfunc
-
-func! rainbow_parentheses#toggleall()
- if !exists('s:active')
- cal rainbow_parentheses#load(0)
- cal rainbow_parentheses#load(1)
- cal rainbow_parentheses#load(2)
- endif
- if exists('s:active') && s:active
- cal rainbow_parentheses#clear()
- else
- cal rainbow_parentheses#activate()
- endif
-endfunc
-
-func! s:cluster()
- let levels = join(map(range(1, s:max), '"level".v:val'), ',')
- exe 'sy cluster rainbow_parentheses contains=@TOP'.levels.',NoInParens'
-endfunc
-cal s:cluster()
-
-func! rainbow_parentheses#load(...)
- let [level, grp, type] = ['', '', s:types[a:1]]
- let alllvls = map(range(1, s:max), '"level".v:val')
- if !exists('b:loaded')
- let b:loaded = [0,0,0,0]
- endif
- let b:loaded[a:1] = s:loadtgl && b:loaded[a:1] ? 0 : 1
- for each in range(1, s:max)
- let region = 'level'. each .(b:loaded[a:1] ? '' : 'none')
- let grp = b:loaded[a:1] ? 'level'.each.'c' : 'Normal'
- let cmd = 'sy region %s matchgroup=%s start=/%s/ end=/%s/ contains=TOP,%s,NoInParens'
- exe printf(cmd, region, grp, type[0], type[1], join(alllvls, ','))
- cal remove(alllvls, 0)
- endfor
-endfunc
-
-" vim:ts=2:sw=2:sts=2
diff --git a/config/vim/plugin/pickachu.vim b/config/vim/plugin/pickachu.vim
deleted file mode 100644
index 259bac7..0000000
--- a/config/vim/plugin/pickachu.vim
+++ /dev/null
@@ -1,45 +0,0 @@
-"Script: Pickachu
-"Version: 0.0.1
-"Copyright: Copyright (C) 2018 Doug Beney
-"Licence:
-"Website: https://dougie.io
-
-if !has('python3')
- echo "You need Vim Python3 support to use this plugin. If you're using NeoVim, try running `pip3 install neovim` to resolve this issue."
-endif
-
-if !exists('g:pickachu_default_app')
- let g:pickachu_default_app = "color"
-endif
-
-if !exists("g:pickachu_default_command")
- let g:pickachu_default_command = "zenity"
-endif
-
-if !exists("g:pickachu_default_date_format")
- let g:pickachu_default_date_format = "%m/%d/%Y"
-endif
-
-if !exists("g:pickachu_default_color_format")
- let g:pickachu_default_color_format = "hex"
-endif
-
-function! s:pickachuCompletion(ArgLead, CmdLine, CursorPos)
- let options = ['color', 'date', 'file']
- return options
-endfunction
-
-command! -nargs=* -complete=customlist,<SID>pickachuCompletion Pickachu call Pickachu(<f-args>)
-
-python3 import sys
-python3 import vim
-python3 sys.path.append(vim.eval('expand("<sfile>:h")'))
-
-function! Pickachu(...)
-python3 << EOF
-from pickachu.main import MainFunction
-MainFunction()
-EOF
-endfunction
-
-" vim: noexpandtab
diff --git a/config/vim/plugin/pickachu/__init__.py b/config/vim/plugin/pickachu/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/config/vim/plugin/pickachu/__init__.py
+++ /dev/null
diff --git a/config/vim/plugin/pickachu/__pycache__/__init__.cpython-39.pyc b/config/vim/plugin/pickachu/__pycache__/__init__.cpython-39.pyc
deleted file mode 100644
index c18ad9c..0000000
--- a/config/vim/plugin/pickachu/__pycache__/__init__.cpython-39.pyc
+++ /dev/null
Binary files differ
diff --git a/config/vim/plugin/pickachu/__pycache__/apps.cpython-39.pyc b/config/vim/plugin/pickachu/__pycache__/apps.cpython-39.pyc
deleted file mode 100644
index c564bcc..0000000
--- a/config/vim/plugin/pickachu/__pycache__/apps.cpython-39.pyc
+++ /dev/null
Binary files differ
diff --git a/config/vim/plugin/pickachu/__pycache__/main.cpython-39.pyc b/config/vim/plugin/pickachu/__pycache__/main.cpython-39.pyc
deleted file mode 100644
index c35190e..0000000
--- a/config/vim/plugin/pickachu/__pycache__/main.cpython-39.pyc
+++ /dev/null
Binary files differ
diff --git a/config/vim/plugin/pickachu/__pycache__/processors.cpython-39.pyc b/config/vim/plugin/pickachu/__pycache__/processors.cpython-39.pyc
deleted file mode 100644
index 1cf1153..0000000
--- a/config/vim/plugin/pickachu/__pycache__/processors.cpython-39.pyc
+++ /dev/null
Binary files differ
diff --git a/config/vim/plugin/pickachu/apps.py b/config/vim/plugin/pickachu/apps.py
deleted file mode 100644
index 00a6826..0000000
--- a/config/vim/plugin/pickachu/apps.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import vim
-import subprocess
-from . import processors
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# name: apps.py
-# description: this function contains a dictionary object
-# where you can easily add new apps with processor
-# functions to handle their output. Note: a
-# processor is optional.
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-ZENITY_COMMAND = vim.eval("g:pickachu_default_command")
-# Note: This is not the final date format that displays on
-# the users' buffer. This is the format we force
-# Zenity/Qarma to provide us.
-RETURNED_DATE_FORMAT = "%m/%d/%Y"
-if ZENITY_COMMAND == 'qarma':
- RETURNED_DATE_FORMAT = "MM/dd/yy"
-
-apps = {
- 'date': {
- 'cmd': ZENITY_COMMAND,
- 'processor': processors.dateProcessor,
- 'options': [
- '--calendar',
- '--date-format=' + RETURNED_DATE_FORMAT
- ]
- },
- 'file': {
- 'cmd': ZENITY_COMMAND,
- 'options': [
- '--file-selection'
- ]
- },
- 'color': {
- 'cmd': ZENITY_COMMAND,
- 'options': [
- '--color-selection'
- ],
- 'processor': processors.colorProcessor
- }
-}
-
-def runApp(choosenApp, format=None):
- app = apps.get(choosenApp, None)
- if app:
- output = None
- try:
- command_array = [app['cmd']]
- if app.get('options', False):
- for option in app['options']:
- command_array.append(option)
- # Logging
- command_array.append('2> /tmp/pickachu_log')
- output = subprocess.check_output(command_array).decode('utf-8')
- except:
- return None
-
- if app.get('processor', None):
- if format:
- return app['processor'](output.rstrip(), format)
- else:
- return app['processor'](output.rstrip())
- else:
- return output.rstrip()
- else:
- print("App does not exist.")
diff --git a/config/vim/plugin/pickachu/main.py b/config/vim/plugin/pickachu/main.py
deleted file mode 100644
index d9a42b3..0000000
--- a/config/vim/plugin/pickachu/main.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import vim
-from . import apps
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# name: main.py
-# description: This file evaluates the command arguments
-# provided by the user, calls the runApp function,
-# and inserts valid output to the user's buffer.
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-DEFAULT_APP = vim.eval('g:pickachu_default_app')
-
-
-def MainFunction():
- # This section is for getting the
- # arguments from the user's Vim
- # command.
- arglength = int(vim.eval('a:0'))
- CHOOSEN_APP = DEFAULT_APP
- CHOOSEN_FORMAT = None
- if arglength > 0:
- CHOOSEN_APP = vim.eval('a:1')
- if arglength > 1:
- CHOOSEN_FORMAT = vim.eval('a:2')
-
- # We run apps.py's runApp function to get an output.
- output = apps.runApp(CHOOSEN_APP, CHOOSEN_FORMAT)
-
- # Now, if runApp gave us an output, we can use the
- # Vim API to print the output to the user's buffer.
- if output:
- pos_y, pos_x = vim.current.window.cursor
- vim.current.line = vim.current.line[:pos_x+1] + output + vim.current.line[pos_x+1:]
- vim.current.window.cursor = (pos_y, pos_x + len(output))
- else:
- print('Pickachu - Canceled')
diff --git a/config/vim/plugin/pickachu/processors.py b/config/vim/plugin/pickachu/processors.py
deleted file mode 100644
index 0fe04c1..0000000
--- a/config/vim/plugin/pickachu/processors.py
+++ /dev/null
@@ -1,80 +0,0 @@
-import vim
-from datetime import datetime
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# name: processors.py
-# description: this file contains functions that process data
-# from the runapp function (in app.py).
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-DEFAULT_DATE_FORMAT = vim.eval("g:pickachu_default_date_format")
-DEFAULT_COLOR_FORMAT = vim.eval("g:pickachu_default_color_format")
-
-def dateProcessor(input, format=DEFAULT_DATE_FORMAT):
- try:
- dateObj = datetime.strptime(input, '%m/%d/%Y')
- except(ValueError):
- dateObj = datetime.strptime(input, '%m/%d/%y')
- return dateObj.strftime(format)
-
-def colorProcessor(input, format=DEFAULT_COLOR_FORMAT):
- # The system color picker returned an rgba value
- if 'rgba' in input:
- strip = input.strip('rgba)(')
- array = strip.split(',')
- # Round the alpha value to two decimal placed
- array[3] = round(float(array[3]), 2)
- rgba_string = "rgba("
- values = ",".join(str(x) for x in array)
- rgba_string += values + ")"
- return rgba_string
- # The system color picker returned an rgb value
- elif 'rgb' in input:
- # RGB as input
- if format == 'rgb':
- return input
- else:
- # Strip 'rgb' and parenthesis
- strip = input.strip('rgb)(')
- array = strip.split(',')
-
- if format == 'hex':
- hex = '#%02x%02x%02x' % (int(array[0]), int(array[1]), int(array[2]))
- return hex.upper()
- elif format == 'rgba':
- rgba_string = "rgba("
- array.append(1)
- values = ",".join(str(x) for x in array)
- rgba_string += values + ")"
- return rgba_string
- return array
- # The system olor picker returned a hex
- elif '#' in input:
- # If there is a '#' in input,
- # they are most likely using Qarma instead of Zenity
- # or any other program that outputs hex
- if format == 'hex':
- return input
- else:
- hex = input.lstrip('#')
- rgb_array = tuple(int(hex[i:i+2], 16) for i in (0, 2 ,4))
-
- if format == 'rgb':
- rgb_string = "rgb("
- for i in range(0, len(rgb_array)):
- rgb_string += str(rgb_array[i])
- if i < len(rgb_array) - 1:
- rgb_string += ", "
- else:
- rgb_string += ")"
- return rgb_string
- elif format == 'rgba':
- rgba_string = "rgba("
- for i in range(0, len(rgb_array)):
- rgba_string += str(rgb_array[i])
- if i < len(rgb_array) - 1:
- rgba_string += ", "
- else:
- rgba_string += ", 1)"
- return rgba_string
- return None
diff --git a/config/vim/plugin/rainbow_parentheses.vim b/config/vim/plugin/rainbow_parentheses.vim
deleted file mode 100644
index 20ce8e5..0000000
--- a/config/vim/plugin/rainbow_parentheses.vim
+++ /dev/null
@@ -1,13 +0,0 @@
-"==============================================================================
-" Description: Rainbow colors for parentheses, based on rainbow_parenthsis.vim
-" by Martin Krischik and others.
-"==============================================================================
-" GetLatestVimScripts: 3772 1 :AutoInstall: rainbow_parentheses.zip
-
-com! RainbowParenthesesToggle cal rainbow_parentheses#toggle()
-com! RainbowParenthesesToggleAll cal rainbow_parentheses#toggleall()
-com! RainbowParenthesesActivate cal rainbow_parentheses#activate()
-com! RainbowParenthesesLoadRound cal rainbow_parentheses#load(0)
-com! RainbowParenthesesLoadSquare cal rainbow_parentheses#load(1)
-com! RainbowParenthesesLoadBraces cal rainbow_parentheses#load(2)
-com! RainbowParenthesesLoadChevrons cal rainbow_parentheses#load(3)
diff --git a/config/vim/vimrc b/config/vim/vimrc
index a80b019..0e1b77b 100644
--- a/config/vim/vimrc
+++ b/config/vim/vimrc
@@ -33,4 +33,4 @@ nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
-nnoremap <F9> :w<Enter>:!"%:p"<Enter>
+nnoremap <F9> :w<Enter>:!chmod<Space>+x<Space>"%:p"<Enter>:!"%:p"<Enter>