Adding upstream version 0.16.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
203fae4667
commit
54898c7244
14 changed files with 83 additions and 889 deletions
|
@ -3,10 +3,12 @@ _gita_completions()
|
|||
{
|
||||
|
||||
local cur commands repos cmd
|
||||
local IFS=$'\n\t '
|
||||
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
cmd=${COMP_WORDS[1]}
|
||||
|
||||
|
||||
# this doesn't work for two repos with the same basename
|
||||
#gita_path=${XDG_CONFIG_HOME:-$HOME/.config}/gita/repo_path
|
||||
#repos=`awk '{split($0, paths, ":")} END {for (i in paths) {n=split(paths[i],b, /\//); print b[n]}}' ${gita_path}`
|
||||
|
|
4
Makefile
4
Makefile
|
@ -2,9 +2,9 @@
|
|||
|
||||
install:
|
||||
pip3 install -e .
|
||||
test: clean
|
||||
test:
|
||||
pytest tests --cov=./gita $(TEST_ARGS) -n=auto
|
||||
dist: clean
|
||||
dist:
|
||||
python3 setup.py sdist
|
||||
twine:
|
||||
twine upload dist/*
|
||||
|
|
15
README.md
15
README.md
|
@ -14,18 +14,15 @@
|
|||
| | ____ | | | | | ___ |
|
||||
| | \_ ) | | | | | ( ) |
|
||||
| (___) |__) (___ | | | ) ( |
|
||||
(_______)_______/ )_( |/ \| v0.15
|
||||
(_______)_______/ )_( |/ \| v0.16
|
||||
```
|
||||
|
||||
# Gita: a command-line tool to manage multiple git repos
|
||||
|
||||
This tool does two things
|
||||
This tool has two main features
|
||||
|
||||
- display the status of multiple git repos such as branch, modification, commit message side by side
|
||||
- (batch) delegate git commands/aliases from any working directory
|
||||
|
||||
If several repos are related, it helps to see their status together.
|
||||
I also hate to change directories to execute git commands.
|
||||
- (batch) delegate git commands/aliases and shell commands on repos from any working directory
|
||||
|
||||

|
||||
|
||||
|
@ -39,6 +36,9 @@ To add your own commands, see the [customization section](#custom).
|
|||
To run arbitrary `git` command, see the [superman mode section](#superman).
|
||||
To run arbitrary shell command, see the [shell mode section](#shell).
|
||||
|
||||
I also made a youtube video to demonstrate the common usages
|
||||
[](https://www.youtube.com/watch?v=ySWbwQcbhqI)
|
||||
|
||||
The branch color distinguishes 5 situations between local and remote branches:
|
||||
|
||||
color | meaning
|
||||
|
@ -65,7 +65,7 @@ symbol | meaning
|
|||
|
||||
The bookkeeping sub-commands are
|
||||
|
||||
- `gita add <repo-path(s)>`: add repo(s) to `gita`
|
||||
- `gita add <repo-path(s)> [-g <groupname>]`: add repo(s) to `gita`, optionally into an existing group
|
||||
- `gita add -a <repo-parent-path(s)>`: add repo(s) in <repo-parent-path(s)> recursively
|
||||
and automatically generate hierarchical groups. See the [customization section](#custom) for more details.
|
||||
- `gita add -b <bare-repo-path(s)>`: add bare repo(s) to `gita`. See the [customization section](#custom) for more details on setting custom worktree.
|
||||
|
@ -79,6 +79,7 @@ The bookkeeping sub-commands are
|
|||
- `gita context none`: remove context
|
||||
- `gita color`: color sub-command
|
||||
- `gita color [ll]`: Show available colors and the current coloring scheme
|
||||
- `gita color reset`: Reset to the default coloring scheme
|
||||
- `gita color set <situation> <color>`: Use the specified color for the local-remote situation
|
||||
- `gita flags`: flags sub-command
|
||||
- `gita flags set <repo-name> <flags>`: add custom `flags` to repo
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
| | ____ | | | | | ___ |
|
||||
| | \_ ) | | | | | ( ) |
|
||||
| (___) |__) (___ | | | ) ( |
|
||||
(_______)_______/ )_( |/ \| v0.15
|
||||
(_______)_______/ )_( |/ \| v0.16
|
||||
```
|
||||
|
||||
# Gita:一个管理多个 git 库的命令行工具
|
||||
|
|
BIN
doc/video-outline.png
Normal file
BIN
doc/video-outline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 165 KiB |
|
@ -59,34 +59,24 @@ def f_add(args: argparse.Namespace):
|
|||
repos = utils.get_repos()
|
||||
paths = args.paths
|
||||
groups = utils.get_groups()
|
||||
if 0:
|
||||
# add to global and tag as main
|
||||
main_repos = utils.add_repos(repos, paths, repo_type='m')
|
||||
# add sub-repo recursively and save to local config
|
||||
for name, prop in main_repos.items():
|
||||
main_path = prop['path']
|
||||
print('Inside main repo:', name)
|
||||
#sub_paths = Path(main_path).glob('**')
|
||||
sub_paths = glob.glob(os.path.join(main_path,'**/'), recursive=True)
|
||||
utils.add_repos({}, sub_paths, root=main_path)
|
||||
else:
|
||||
if args.recursive or args.auto_group:
|
||||
paths = (p.rstrip(os.path.sep) for p in chain.from_iterable(
|
||||
glob.glob(os.path.join(p, '**/'), recursive=True)
|
||||
for p in args.paths))
|
||||
new_repos = utils.add_repos(repos, paths, is_bare=args.bare)
|
||||
if new_repos and args.auto_group:
|
||||
new_groups = utils.auto_group(new_repos, args.paths)
|
||||
if new_groups:
|
||||
print(f'Created {len(new_groups)} new group(s).')
|
||||
utils.write_to_groups_file(new_groups, 'a+')
|
||||
if new_repos and args.group:
|
||||
gname = args.group
|
||||
gname_repos = set(groups[gname]['repos'])
|
||||
gname_repos.update(new_repos)
|
||||
groups[gname]['repos'] = sorted(gname_repos)
|
||||
print(f'Added {len(new_repos)} repos to the {gname} group')
|
||||
utils.write_to_groups_file(groups, 'w')
|
||||
if args.recursive or args.auto_group:
|
||||
paths = (p.rstrip(os.path.sep) for p in chain.from_iterable(
|
||||
glob.glob(os.path.join(p, '**/'), recursive=True)
|
||||
for p in args.paths))
|
||||
new_repos = utils.add_repos(repos, paths, include_bare=args.bare,
|
||||
exclude_submodule=args.skip_submodule)
|
||||
if new_repos and args.auto_group:
|
||||
new_groups = utils.auto_group(new_repos, args.paths)
|
||||
if new_groups:
|
||||
print(f'Created {len(new_groups)} new group(s).')
|
||||
utils.write_to_groups_file(new_groups, 'a+')
|
||||
if new_repos and args.group:
|
||||
gname = args.group
|
||||
gname_repos = set(groups[gname]['repos'])
|
||||
gname_repos.update(new_repos)
|
||||
groups[gname]['repos'] = sorted(gname_repos)
|
||||
print(f'Added {len(new_repos)} repos to the {gname} group')
|
||||
utils.write_to_groups_file(groups, 'w')
|
||||
|
||||
|
||||
def f_rename(args: argparse.Namespace):
|
||||
|
@ -164,11 +154,11 @@ def f_freeze(_):
|
|||
seen = {''}
|
||||
for name, prop in repos.items():
|
||||
path = prop['path']
|
||||
# TODO: What do we do with main repos? Maybe give an option to print
|
||||
# their sub-repos too.
|
||||
url = ''
|
||||
cp = subprocess.run(['git', 'remote', '-v'], cwd=path, capture_output=True)
|
||||
lines = cp.stdout.decode('utf-8').split('\n')
|
||||
# FIXME: capture_output is new in 3.7. Maybe drop support for 3.6
|
||||
cp = subprocess.run(['git', 'remote', '-v'], cwd=path,
|
||||
universal_newlines=True, capture_output=True)
|
||||
lines = cp.stdout.split('\n')
|
||||
if cp.returncode == 0 and len(lines) > 0:
|
||||
parts = lines[0].split()
|
||||
if len(parts)>1:
|
||||
|
@ -402,6 +392,8 @@ def main(argv=None):
|
|||
p_add.add_argument('-g','--group',
|
||||
choices=utils.get_groups(),
|
||||
help="add repo(s) to the specified group")
|
||||
p_add.add_argument('-s', '--skip-submodule', action='store_true',
|
||||
help="skip submodule repo(s)")
|
||||
xgroup = p_add.add_mutually_exclusive_group()
|
||||
xgroup.add_argument('-r', '--recursive', action='store_true',
|
||||
help="recursively add repo(s) in the given path(s).")
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import os
|
||||
|
||||
|
||||
def get_config_dir(root=None) -> str:
|
||||
if root is None:
|
||||
root = os.environ.get('XDG_CONFIG_HOME') or os.path.join(
|
||||
os.path.expanduser('~'), '.config')
|
||||
return os.path.join(root, "gita")
|
||||
else:
|
||||
return os.path.join(root, ".gita")
|
||||
def get_config_dir() -> str:
|
||||
root = os.environ.get('XDG_CONFIG_HOME') or os.path.join(
|
||||
os.path.expanduser('~'), '.config')
|
||||
return os.path.join(root, "gita")
|
||||
|
||||
|
||||
def get_config_fname(fname: str, root=None) -> str:
|
||||
def get_config_fname(fname: str) -> str:
|
||||
"""
|
||||
Return the file name that stores the repo locations.
|
||||
"""
|
||||
return os.path.join(get_config_dir(root), fname)
|
||||
return os.path.join(get_config_dir(), fname)
|
||||
|
|
100
gita/utils.py
100
gita/utils.py
|
@ -38,14 +38,12 @@ def get_relative_path(kid: str, parent: str) -> Union[List[str], None]:
|
|||
|
||||
|
||||
@lru_cache()
|
||||
def get_repos(root=None) -> Dict[str, Dict[str, str]]:
|
||||
def get_repos() -> Dict[str, Dict[str, str]]:
|
||||
"""
|
||||
Return a `dict` of repo name to repo absolute path and repo type
|
||||
|
||||
@param root: Use local config if set. If None, use either global or local
|
||||
config depending on cwd.
|
||||
"""
|
||||
path_file = common.get_config_fname('repos.csv', root)
|
||||
path_file = common.get_config_fname('repos.csv')
|
||||
repos = {}
|
||||
if os.path.isfile(path_file) and os.stat(path_file).st_size > 0:
|
||||
with open(path_file) as f:
|
||||
|
@ -54,13 +52,7 @@ def get_repos(root=None) -> Dict[str, Dict[str, str]]:
|
|||
repos = {r['name']:
|
||||
{'path': r['path'], 'type': r['type'],
|
||||
'flags': r['flags'].split()}
|
||||
for r in rows if is_git(r['path'], is_bare=True)}
|
||||
if root is None: # detect if inside a main path
|
||||
cwd = os.getcwd()
|
||||
for prop in repos.values():
|
||||
path = prop['path']
|
||||
if prop['type'] == 'm' and get_relative_path(cwd, path) != MAX_INT:
|
||||
return get_repos(path)
|
||||
for r in rows if is_git(r['path'], include_bare=True)}
|
||||
return repos
|
||||
|
||||
|
||||
|
@ -82,7 +74,6 @@ def get_context() -> Union[Path, None]:
|
|||
ctx = matches[0]
|
||||
if ctx.stem == 'auto':
|
||||
cwd = str(Path.cwd())
|
||||
repos = get_repos()
|
||||
# The context is set to be the group with minimal distance to cwd
|
||||
candidate = None
|
||||
min_dist = MAX_INT
|
||||
|
@ -102,7 +93,7 @@ def get_context() -> Union[Path, None]:
|
|||
|
||||
|
||||
@lru_cache()
|
||||
def get_groups() -> Dict[str, Dict]:
|
||||
def get_groups() -> Dict[str, Dict[str, Union[str, List]]]:
|
||||
"""
|
||||
Return a `dict` of group name to group properties such as repo names and
|
||||
group path.
|
||||
|
@ -152,7 +143,7 @@ def replace_context(old: Union[Path, None], new: str):
|
|||
# ctx.rename(ctx.with_stem(new_name)) # only works in py3.9
|
||||
old.rename(old.with_name(f'{new}.context'))
|
||||
else:
|
||||
open(auto.with_name(f'{new}.context'), 'w').close()
|
||||
Path(auto.with_name(f'{new}.context')).write_text('')
|
||||
|
||||
|
||||
def get_choices() -> List[Union[str, None]]:
|
||||
|
@ -170,7 +161,16 @@ def get_choices() -> List[Union[str, None]]:
|
|||
return choices
|
||||
|
||||
|
||||
def is_git(path: str, is_bare=False) -> bool:
|
||||
def is_submodule_repo(p: Path) -> bool:
|
||||
"""
|
||||
|
||||
"""
|
||||
if p.is_file() and '.git/modules' in p.read_text():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_git(path: str, include_bare=False, exclude_submodule=False) -> bool:
|
||||
"""
|
||||
Return True if the path is a git repo.
|
||||
"""
|
||||
|
@ -178,16 +178,18 @@ def is_git(path: str, is_bare=False) -> bool:
|
|||
return False
|
||||
# An alternative is to call `git rev-parse --is-inside-work-tree`
|
||||
# I don't see why that one is better yet.
|
||||
# For a regular git repo, .git is a folder, for a worktree repo, .git is a file.
|
||||
# However, git submodule repo also has .git as a file.
|
||||
# For a regular git repo, .git is a folder. For a worktree repo and
|
||||
# submodule repo, .git is a file.
|
||||
# A more reliable way to differentiable regular and worktree repos is to
|
||||
# compare the result of `git rev-parse --git-dir` and
|
||||
# `git rev-parse --git-common-dir`
|
||||
loc = os.path.join(path, '.git')
|
||||
# TODO: we can display the worktree repos in a different font.
|
||||
if os.path.exists(loc):
|
||||
if exclude_submodule and is_submodule_repo(Path(loc)):
|
||||
return False
|
||||
return True
|
||||
if not is_bare:
|
||||
if not include_bare:
|
||||
return False
|
||||
# detect bare repo
|
||||
got = subprocess.run('git rev-parse --is-bare-repository'.split(),
|
||||
|
@ -209,37 +211,26 @@ def rename_repo(repos: Dict[str, Dict[str, str]], repo: str, new_name: str):
|
|||
prop = repos[repo]
|
||||
del repos[repo]
|
||||
repos[new_name] = prop
|
||||
# write to local config if inside a main path
|
||||
main_paths = (prop['path'] for prop in repos.values() if prop['type'] == 'm')
|
||||
cwd = os.getcwd()
|
||||
is_local_config = True
|
||||
# TODO: delete
|
||||
for p in main_paths:
|
||||
if get_relative_path(cwd, p) != MAX_INT:
|
||||
write_to_repo_file(repos, 'w', p)
|
||||
break
|
||||
else: # global config
|
||||
write_to_repo_file(repos, 'w')
|
||||
is_local_config = False
|
||||
# update groups only when outside any main repos
|
||||
if is_local_config:
|
||||
return
|
||||
write_to_repo_file(repos, 'w')
|
||||
|
||||
groups = get_groups()
|
||||
for g, members in groups.items():
|
||||
for g, values in groups.items():
|
||||
members = values['repos']
|
||||
if repo in members:
|
||||
members.remove(repo)
|
||||
members.append(new_name)
|
||||
groups[g] = sorted(members)
|
||||
groups[g]['repos'] = sorted(members)
|
||||
write_to_groups_file(groups, 'w')
|
||||
|
||||
|
||||
def write_to_repo_file(repos: Dict[str, Dict[str, str]], mode: str, root=None):
|
||||
def write_to_repo_file(repos: Dict[str, Dict[str, str]], mode: str):
|
||||
"""
|
||||
@param repos: each repo is {name: {properties}}
|
||||
"""
|
||||
data = [(prop['path'], name, prop['type'], ' '.join(prop['flags']))
|
||||
# The 3rd column is repo type; unused field
|
||||
data = [(prop['path'], name, '', ' '.join(prop['flags']))
|
||||
for name, prop in repos.items()]
|
||||
fname = common.get_config_fname('repos.csv', root)
|
||||
fname = common.get_config_fname('repos.csv')
|
||||
os.makedirs(os.path.dirname(fname), exist_ok=True)
|
||||
with open(fname, mode, newline='') as f:
|
||||
writer = csv.writer(f, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
|
@ -254,7 +245,7 @@ def write_to_groups_file(groups: Dict[str, Dict], mode: str):
|
|||
fname = common.get_config_fname('groups.csv')
|
||||
os.makedirs(os.path.dirname(fname), exist_ok=True)
|
||||
if not groups: # all groups are deleted
|
||||
open(fname, 'w').close()
|
||||
Path(fname).write_text('')
|
||||
else:
|
||||
# delete the group if there are no repos
|
||||
for name in list(groups):
|
||||
|
@ -285,27 +276,17 @@ def _make_name(path: str, repos: Dict[str, Dict[str, str]],
|
|||
return name
|
||||
|
||||
|
||||
# TODO: delete
|
||||
def _get_repo_type(path, repo_type, root) -> str:
|
||||
"""
|
||||
|
||||
"""
|
||||
if repo_type != '': # explicitly set
|
||||
return repo_type
|
||||
if root is not None and os.path.normpath(root) == os.path.normpath(path):
|
||||
return 'm'
|
||||
return ''
|
||||
|
||||
|
||||
def add_repos(repos: Dict[str, Dict[str, str]], new_paths: List[str],
|
||||
repo_type='', root=None, is_bare=False) -> Dict[str, Dict[str, str]]:
|
||||
include_bare=False,
|
||||
exclude_submodule=False,
|
||||
) -> Dict[str, Dict[str, str]]:
|
||||
"""
|
||||
Write new repo paths to file; return the added repos.
|
||||
|
||||
@param repos: name -> path
|
||||
"""
|
||||
existing_paths = {prop['path'] for prop in repos.values()}
|
||||
new_paths = {p for p in new_paths if is_git(p, is_bare)}
|
||||
new_paths = {p for p in new_paths if is_git(p, include_bare, exclude_submodule)}
|
||||
new_paths = new_paths - existing_paths
|
||||
new_repos = {}
|
||||
if new_paths:
|
||||
|
@ -315,12 +296,9 @@ def add_repos(repos: Dict[str, Dict[str, str]], new_paths: List[str],
|
|||
)
|
||||
new_repos = {_make_name(path, repos, name_counts): {
|
||||
'path': path,
|
||||
'type': _get_repo_type(path, repo_type, root),
|
||||
'flags': '',
|
||||
} for path in new_paths}
|
||||
# When root is not None, we could optionally set its type to 'm', i.e.,
|
||||
# main repo.
|
||||
write_to_repo_file(new_repos, 'a+', root)
|
||||
write_to_repo_file(new_repos, 'a+')
|
||||
else:
|
||||
print('No new repos found!')
|
||||
return new_repos
|
||||
|
@ -442,13 +420,7 @@ def describe(repos: Dict[str, Dict[str, str]], no_colors: bool = False) -> str:
|
|||
|
||||
for name in sorted(repos):
|
||||
info_items = ' '.join(f(repos[name]) for f in funcs)
|
||||
if repos[name]['type'] == 'm':
|
||||
# ANSI color code also takes length in Python
|
||||
name = f'{info.Color.underline}{name}{info.Color.end}'
|
||||
width = name_width + 8
|
||||
yield f'{name:<{width}}{info_items}'
|
||||
else:
|
||||
yield f'{name:<{name_width}}{info_items}'
|
||||
yield f'{name:<{name_width}}{info_items}'
|
||||
|
||||
|
||||
def get_cmds_from_files() -> Dict[str, Dict[str, str]]:
|
||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ with open('README.md', encoding='utf-8') as f:
|
|||
setup(
|
||||
name='gita',
|
||||
packages=['gita'],
|
||||
version='0.15.8',
|
||||
version='0.16.1',
|
||||
license='MIT',
|
||||
description='Manage multiple git repos with sanity',
|
||||
long_description=long_description,
|
||||
|
|
|
@ -11,7 +11,6 @@ def fullpath(fname: str):
|
|||
PATH_FNAME = fullpath('mock_path_file')
|
||||
PATH_FNAME_EMPTY = fullpath('empty_path_file')
|
||||
PATH_FNAME_CLASH = fullpath('clash_path_file')
|
||||
PATH_FNAME_MAIN = fullpath('main_path_file')
|
||||
GROUP_FNAME = fullpath('mock_group_file')
|
||||
|
||||
def async_mock():
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
/path/to/main/,main1,m
|
||||
/xxx/xx,xx,
|
|
@ -9,7 +9,7 @@ import shlex
|
|||
from gita import __main__
|
||||
from gita import utils, info, common
|
||||
from conftest import (
|
||||
PATH_FNAME, PATH_FNAME_EMPTY, PATH_FNAME_CLASH, GROUP_FNAME, PATH_FNAME_MAIN,
|
||||
PATH_FNAME, PATH_FNAME_EMPTY, PATH_FNAME_CLASH, GROUP_FNAME,
|
||||
async_mock, TEST_DIR,
|
||||
)
|
||||
|
||||
|
@ -115,8 +115,6 @@ class TestLsLl:
|
|||
(PATH_FNAME,
|
||||
"repo1 cmaster dsu\x1b[0m msg \nrepo2 cmaster dsu\x1b[0m msg \nxxx cmaster dsu\x1b[0m msg \n"),
|
||||
(PATH_FNAME_EMPTY, ""),
|
||||
(PATH_FNAME_MAIN,
|
||||
'\x1b[4mmain1\x1b[0m cmaster dsu\x1b[0m msg \nxx cmaster dsu\x1b[0m msg \n'),
|
||||
(PATH_FNAME_CLASH,
|
||||
"repo1 cmaster dsu\x1b[0m msg \nrepo2 cmaster dsu\x1b[0m msg \n"
|
||||
),
|
||||
|
@ -188,6 +186,7 @@ def test_clone_with_preserve_path(*_):
|
|||
mock_run.assert_called_once_with('repo', Path.cwd(), cmds)
|
||||
|
||||
|
||||
@patch('os.makedirs')
|
||||
@patch('os.path.isfile', return_value=True)
|
||||
@patch('gita.common.get_config_fname', return_value='some path')
|
||||
@patch('gita.utils.get_repos', return_value={'repo1': {'path': '/a/', 'type': ''},
|
||||
|
|
|
@ -176,4 +176,4 @@ def test_is_git(tmpdir):
|
|||
with tmpdir.as_cwd():
|
||||
subprocess.run('git init --bare .'.split())
|
||||
assert utils.is_git(Path.cwd()) is False
|
||||
assert utils.is_git(Path.cwd(), is_bare=True) is True
|
||||
assert utils.is_git(Path.cwd(), include_bare=True) is True
|
||||
|
|
766
work.vim
766
work.vim
|
@ -1,766 +0,0 @@
|
|||
let SessionLoad = 1
|
||||
if &cp | set nocp | endif
|
||||
let s:cpo_save=&cpo
|
||||
set cpo&vim
|
||||
inoremap <silent> <Plug>(-fzf-complete-finish) l
|
||||
inoremap <silent> <Plug>CocRefresh =coc#_complete()
|
||||
inoremap <silent> <Plug>(fzf-maps-i) :call fzf#vim#maps('i', 0)
|
||||
inoremap <expr> <Plug>(fzf-complete-buffer-line) fzf#vim#complete#buffer_line()
|
||||
inoremap <expr> <Plug>(fzf-complete-line) fzf#vim#complete#line()
|
||||
inoremap <expr> <Plug>(fzf-complete-file-ag) fzf#vim#complete#path('ag -l -g ""')
|
||||
inoremap <expr> <Plug>(fzf-complete-file) fzf#vim#complete#path("find . -path '*/\.*' -prune -o -type f -print -o -type l -print | sed 's:^..::'")
|
||||
inoremap <expr> <Plug>(fzf-complete-path) fzf#vim#complete#path("find . -path '*/\.*' -prune -o -print | sed '1d;s:^..::'")
|
||||
inoremap <expr> <Plug>(fzf-complete-word) fzf#vim#complete#word()
|
||||
inoremap <silent> <SNR>20_AutoPairsReturn =AutoPairsReturn()
|
||||
inoremap <silent> <expr> <C-Space> coc#refresh()
|
||||
inoremap <expr> <S-Tab> pumvisible() ? "\" : "\"
|
||||
map! <D-v> *
|
||||
nnoremap * *``
|
||||
nmap <silent> ,ig <Plug>IndentGuidesToggle
|
||||
noremap ,4 4gt
|
||||
noremap ,3 3gt
|
||||
noremap ,2 2gt
|
||||
noremap ,1 1gt
|
||||
nmap ,d :GitGutterFold
|
||||
nmap ,r :Rg!
|
||||
nmap ,b :Buffer
|
||||
nmap ,l :Lines!
|
||||
nmap ,w :BLines
|
||||
nmap ,o :Files!
|
||||
nmap ,f :GFiles!
|
||||
nmap ,a :CtrlSF -R ""<Left>
|
||||
nmap ,t :TagbarToggle
|
||||
noremap , :noh
:call clearmatches()
|
||||
vnoremap ,s :sort
|
||||
nnoremap ,s :w
|
||||
noremap ,e :qa!
" Quit all windows
|
||||
noremap ,q :q
" Quit current windows
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
nnoremap N Nzzzv
|
||||
vmap gx <Plug>NetrwBrowseXVis
|
||||
nmap gx <Plug>NetrwBrowseX
|
||||
nmap g> <Plug>(swap-next)
|
||||
nmap g< <Plug>(swap-prev)
|
||||
xmap gs <Plug>(swap-interactive)
|
||||
nmap gs <Plug>(swap-interactive)
|
||||
nmap <silent> gr <Plug>(coc-references)
|
||||
nmap <silent> gi <Plug>(coc-implementation)
|
||||
nmap <silent> gy <Plug>(coc-type-definition)
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
nnoremap n nzzzv
|
||||
nnoremap <silent> <Plug>(-fzf-complete-finish) a
|
||||
nnoremap <Plug>(-fzf-:) :
|
||||
nnoremap <Plug>(-fzf-/) /
|
||||
nnoremap <Plug>(-fzf-vim-do) :execute g:__fzf_command
|
||||
vnoremap <silent> <Plug>NetrwBrowseXVis :call netrw#BrowseXVis()
|
||||
nnoremap <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))
|
||||
onoremap <silent> <Plug>(coc-classobj-a) :call coc#rpc#request('selectSymbolRange', [v:false, '', ['Interface', 'Struct', 'Class']])
|
||||
onoremap <silent> <Plug>(coc-classobj-i) :call coc#rpc#request('selectSymbolRange', [v:true, '', ['Interface', 'Struct', 'Class']])
|
||||
vnoremap <silent> <Plug>(coc-classobj-a) :call coc#rpc#request('selectSymbolRange', [v:false, visualmode(), ['Interface', 'Struct', 'Class']])
|
||||
vnoremap <silent> <Plug>(coc-classobj-i) :call coc#rpc#request('selectSymbolRange', [v:true, visualmode(), ['Interface', 'Struct', 'Class']])
|
||||
onoremap <silent> <Plug>(coc-funcobj-a) :call coc#rpc#request('selectSymbolRange', [v:false, '', ['Method', 'Function']])
|
||||
onoremap <silent> <Plug>(coc-funcobj-i) :call coc#rpc#request('selectSymbolRange', [v:true, '', ['Method', 'Function']])
|
||||
vnoremap <silent> <Plug>(coc-funcobj-a) :call coc#rpc#request('selectSymbolRange', [v:false, visualmode(), ['Method', 'Function']])
|
||||
vnoremap <silent> <Plug>(coc-funcobj-i) :call coc#rpc#request('selectSymbolRange', [v:true, visualmode(), ['Method', 'Function']])
|
||||
nnoremap <silent> <Plug>(coc-cursors-position) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'position', 'n'])
|
||||
nnoremap <silent> <Plug>(coc-cursors-word) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'word', 'n'])
|
||||
vnoremap <silent> <Plug>(coc-cursors-range) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'range', visualmode()])
|
||||
nnoremap <silent> <Plug>(coc-refactor) :call CocActionAsync('refactor')
|
||||
nnoremap <silent> <Plug>(coc-command-repeat) :call CocAction('repeatCommand')
|
||||
nnoremap <silent> <Plug>(coc-float-jump) :call coc#float#jump()
|
||||
nnoremap <silent> <Plug>(coc-float-hide) :call coc#float#close_all()
|
||||
nnoremap <silent> <Plug>(coc-fix-current) :call CocActionAsync('doQuickfix')
|
||||
nnoremap <silent> <Plug>(coc-openlink) :call CocActionAsync('openLink')
|
||||
nnoremap <silent> <Plug>(coc-references-used) :call CocActionAsync('jumpUsed')
|
||||
nnoremap <silent> <Plug>(coc-references) :call CocActionAsync('jumpReferences')
|
||||
nnoremap <silent> <Plug>(coc-type-definition) :call CocActionAsync('jumpTypeDefinition')
|
||||
nnoremap <silent> <Plug>(coc-implementation) :call CocActionAsync('jumpImplementation')
|
||||
nnoremap <silent> <Plug>(coc-declaration) :call CocActionAsync('jumpDeclaration')
|
||||
nnoremap <silent> <Plug>(coc-definition) :call CocActionAsync('jumpDefinition')
|
||||
nnoremap <silent> <Plug>(coc-diagnostic-prev-error) :call CocActionAsync('diagnosticPrevious', 'error')
|
||||
nnoremap <silent> <Plug>(coc-diagnostic-next-error) :call CocActionAsync('diagnosticNext', 'error')
|
||||
nnoremap <silent> <Plug>(coc-diagnostic-prev) :call CocActionAsync('diagnosticPrevious')
|
||||
nnoremap <silent> <Plug>(coc-diagnostic-next) :call CocActionAsync('diagnosticNext')
|
||||
nnoremap <silent> <Plug>(coc-diagnostic-info) :call CocActionAsync('diagnosticInfo')
|
||||
nnoremap <silent> <Plug>(coc-format) :call CocActionAsync('format')
|
||||
nnoremap <silent> <Plug>(coc-rename) :call CocActionAsync('rename')
|
||||
nnoremap <Plug>(coc-codeaction-cursor) :call CocActionAsync('codeAction', 'cursor')
|
||||
nnoremap <Plug>(coc-codeaction-line) :call CocActionAsync('codeAction', 'line')
|
||||
nnoremap <Plug>(coc-codeaction) :call CocActionAsync('codeAction', '')
|
||||
vnoremap <silent> <Plug>(coc-codeaction-selected) :call CocActionAsync('codeAction', visualmode())
|
||||
vnoremap <silent> <Plug>(coc-format-selected) :call CocActionAsync('formatSelected', visualmode())
|
||||
nnoremap <Plug>(coc-codelens-action) :call CocActionAsync('codeLensAction')
|
||||
nnoremap <Plug>(coc-range-select) :call CocActionAsync('rangeSelect', '', v:true)
|
||||
vnoremap <silent> <Plug>(coc-range-select-backward) :call CocActionAsync('rangeSelect', visualmode(), v:false)
|
||||
vnoremap <silent> <Plug>(coc-range-select) :call CocActionAsync('rangeSelect', visualmode(), v:true)
|
||||
noremap <silent> <Plug>(swap-textobject-a) :call swap#textobj#select('a')
|
||||
noremap <silent> <Plug>(swap-textobject-i) :call swap#textobj#select('i')
|
||||
nnoremap <silent> <Plug>(swap-next) :call swap#prerequisite('n', repeat([['#', '#+1']], v:count1))
g@l
|
||||
nnoremap <silent> <Plug>(swap-prev) :call swap#prerequisite('n', repeat([['#', '#-1']], v:count1))
g@l
|
||||
xnoremap <silent> <Plug>(swap-interactive) :call swap#prerequisite('x')
gvg@
|
||||
nnoremap <silent> <Plug>(swap-interactive) :call swap#prerequisite('n')
g@l
|
||||
onoremap <silent> <Plug>(fzf-maps-o) :call fzf#vim#maps('o', 0)
|
||||
xnoremap <silent> <Plug>(fzf-maps-x) :call fzf#vim#maps('x', 0)
|
||||
nnoremap <silent> <Plug>(fzf-maps-n) :call fzf#vim#maps('n', 0)
|
||||
tnoremap <silent> <Plug>(fzf-normal)
|
||||
tnoremap <silent> <Plug>(fzf-insert) i
|
||||
nnoremap <silent> <Plug>(fzf-normal) <Nop>
|
||||
nnoremap <silent> <Plug>(fzf-insert) i
|
||||
nnoremap <Plug>CtrlSFQuickfixPrompt :CtrlSFQuickfix
|
||||
nnoremap <Plug>CtrlSFPrompt :CtrlSF
|
||||
nnoremap <silent> <Plug>GitGutterPreviewHunk :call gitgutter#utility#warn('Please change your map <Plug>GitGutterPreviewHunk to <Plug>(GitGutterPreviewHunk)')
|
||||
nnoremap <silent> <Plug>(GitGutterPreviewHunk) :GitGutterPreviewHunk
|
||||
nnoremap <silent> <Plug>GitGutterUndoHunk :call gitgutter#utility#warn('Please change your map <Plug>GitGutterUndoHunk to <Plug>(GitGutterUndoHunk)')
|
||||
nnoremap <silent> <Plug>(GitGutterUndoHunk) :GitGutterUndoHunk
|
||||
nnoremap <silent> <Plug>GitGutterStageHunk :call gitgutter#utility#warn('Please change your map <Plug>GitGutterStageHunk to <Plug>(GitGutterStageHunk)')
|
||||
nnoremap <silent> <Plug>(GitGutterStageHunk) :GitGutterStageHunk
|
||||
xnoremap <silent> <Plug>GitGutterStageHunk :call gitgutter#utility#warn('Please change your map <Plug>GitGutterStageHunk to <Plug>(GitGutterStageHunk)')
|
||||
xnoremap <silent> <Plug>(GitGutterStageHunk) :GitGutterStageHunk
|
||||
nnoremap <silent> <expr> <Plug>GitGutterPrevHunk &diff ? '[c' : ":\call gitgutter#utility#warn('Please change your map \<Plug>GitGutterPrevHunk to \<Plug>(GitGutterPrevHunk)')\
"
|
||||
nnoremap <silent> <expr> <Plug>(GitGutterPrevHunk) &diff ? '[c' : ":\execute v:count1 . 'GitGutterPrevHunk'\
"
|
||||
nnoremap <silent> <expr> <Plug>GitGutterNextHunk &diff ? ']c' : ":\call gitgutter#utility#warn('Please change your map \<Plug>GitGutterNextHunk to \<Plug>(GitGutterNextHunk)')\
"
|
||||
nnoremap <silent> <expr> <Plug>(GitGutterNextHunk) &diff ? ']c' : ":\execute v:count1 . 'GitGutterNextHunk'\
"
|
||||
xnoremap <silent> <Plug>(GitGutterTextObjectOuterVisual) :call gitgutter#hunk#text_object(0)
|
||||
xnoremap <silent> <Plug>(GitGutterTextObjectInnerVisual) :call gitgutter#hunk#text_object(1)
|
||||
onoremap <silent> <Plug>(GitGutterTextObjectOuterPending) :call gitgutter#hunk#text_object(0)
|
||||
onoremap <silent> <Plug>(GitGutterTextObjectInnerPending) :call gitgutter#hunk#text_object(1)
|
||||
vmap <BS> "-d
|
||||
vmap <D-x> "*d
|
||||
vmap <D-c> "*y
|
||||
vmap <D-v> "-d"*P
|
||||
nmap <D-v> "*P
|
||||
inoremap <expr>
complete_info()["selected"] != "-1" ? "\" : "\u\
"
|
||||
inoremap ,s :w
|
||||
let &cpo=s:cpo_save
|
||||
unlet s:cpo_save
|
||||
set autoindent
|
||||
set background=dark
|
||||
set backspace=2
|
||||
set clipboard=unnamed
|
||||
set expandtab
|
||||
set fileencodings=ucs-bom,utf-8,default,latin1
|
||||
set helplang=en
|
||||
set hlsearch
|
||||
set ignorecase
|
||||
set laststatus=2
|
||||
set modelines=0
|
||||
set path=.,/usr/include,,,**
|
||||
set runtimepath=~/.vim,~/.vim/plugged/vim-gitgutter/,~/.vim/plugged/ctrlsf.vim/,~/.vim/plugged/lightline.vim/,~/.vim/plugged/auto-pairs/,~/.vim/plugged/fzf/,~/.vim/plugged/fzf.vim/,~/.vim/plugged/goyo.vim/,~/.vim/plugged/gv.vim/,~/.vim/plugged/seoul256.vim/,~/.vim/plugged/vim-swap/,~/.vim/plugged/tagbar/,~/.vim/plugged/coc.nvim/,~/.vim/plugged/vim-fugitive/,~/.vim/plugged/vim-indent-guides/,/usr/share/vim/vimfiles,/usr/share/vim/vim82,/usr/share/vim/vimfiles/after,~/.vim/plugged/ctrlsf.vim/after,~/.vim/after
|
||||
set shiftwidth=4
|
||||
set smartcase
|
||||
set noswapfile
|
||||
set tabline=%!lightline#tabline()
|
||||
set tabstop=4
|
||||
set title
|
||||
set updatetime=100
|
||||
set wildignore=*.pyc
|
||||
set wildmenu
|
||||
set wildmode=longest:list,full
|
||||
set window=0
|
||||
set nowritebackup
|
||||
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
|
||||
let v:this_session=expand("<sfile>:p")
|
||||
silent only
|
||||
silent tabonly
|
||||
cd ~/src/gita
|
||||
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
|
||||
let s:wipebuf = bufnr('%')
|
||||
endif
|
||||
set shortmess=aoO
|
||||
argglobal
|
||||
%argdel
|
||||
$argadd gita/__main__.py
|
||||
set stal=2
|
||||
tabnew
|
||||
tabrewind
|
||||
edit gita/utils.py
|
||||
set splitbelow splitright
|
||||
wincmd _ | wincmd |
|
||||
vsplit
|
||||
1wincmd h
|
||||
wincmd w
|
||||
set nosplitbelow
|
||||
set nosplitright
|
||||
wincmd t
|
||||
set winminheight=0
|
||||
set winheight=1
|
||||
set winminwidth=0
|
||||
set winwidth=1
|
||||
exe 'vert 1resize ' . ((&columns * 94 + 94) / 188)
|
||||
exe 'vert 2resize ' . ((&columns * 93 + 94) / 188)
|
||||
argglobal
|
||||
let s:cpo_save=&cpo
|
||||
set cpo&vim
|
||||
inoremap <buffer> <silent> <M-n> :call AutoPairsJump()
a
|
||||
inoremap <buffer> <silent> <expr> <M-p> AutoPairsToggle()
|
||||
inoremap <buffer> <silent> <M-b> =AutoPairsBackInsert()
|
||||
inoremap <buffer> <silent> <C-W> =AutoPairsFastWrap()
|
||||
inoremap <buffer> <silent> <C-H> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> <BS> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> <M-'> =AutoPairsMoveCharacter('''')
|
||||
inoremap <buffer> <silent> <M-"> =AutoPairsMoveCharacter('"')
|
||||
inoremap <buffer> <silent> <M-}> =AutoPairsMoveCharacter('}')
|
||||
inoremap <buffer> <silent> <M-{> =AutoPairsMoveCharacter('{')
|
||||
inoremap <buffer> <silent> <M-]> =AutoPairsMoveCharacter(']')
|
||||
inoremap <buffer> <silent> <M-[> =AutoPairsMoveCharacter('[')
|
||||
inoremap <buffer> <silent> <M-)> =AutoPairsMoveCharacter(')')
|
||||
inoremap <buffer> <silent> <M-(> =AutoPairsMoveCharacter('(')
|
||||
nmap <buffer> ,hp <Plug>(GitGutterPreviewHunk)
|
||||
nmap <buffer> ,hu <Plug>(GitGutterUndoHunk)
|
||||
nmap <buffer> ,hs <Plug>(GitGutterStageHunk)
|
||||
xmap <buffer> ,hs <Plug>(GitGutterStageHunk)
|
||||
inoremap <buffer> <silent> § =AutoPairsMoveCharacter('''')
|
||||
inoremap <buffer> <silent> ¢ =AutoPairsMoveCharacter('"')
|
||||
inoremap <buffer> <silent> © =AutoPairsMoveCharacter(')')
|
||||
inoremap <buffer> <silent> ¨ =AutoPairsMoveCharacter('(')
|
||||
inoremap <buffer> <silent> î :call AutoPairsJump()
a
|
||||
inoremap <buffer> <silent> <expr> ð AutoPairsToggle()
|
||||
inoremap <buffer> <silent> â =AutoPairsBackInsert()
|
||||
inoremap <buffer> <silent> ý =AutoPairsMoveCharacter('}')
|
||||
inoremap <buffer> <silent> û =AutoPairsMoveCharacter('{')
|
||||
inoremap <buffer> <silent> Ý =AutoPairsMoveCharacter(']')
|
||||
inoremap <buffer> <silent> Û =AutoPairsMoveCharacter('[')
|
||||
nmap <buffer> [c <Plug>(GitGutterPrevHunk)
|
||||
nmap <buffer> ]c <Plug>(GitGutterNextHunk)
|
||||
xmap <buffer> ac <Plug>(GitGutterTextObjectOuterVisual)
|
||||
omap <buffer> ac <Plug>(GitGutterTextObjectOuterPending)
|
||||
xmap <buffer> ic <Plug>(GitGutterTextObjectInnerVisual)
|
||||
omap <buffer> ic <Plug>(GitGutterTextObjectInnerPending)
|
||||
noremap <buffer> <silent> <M-n> :call AutoPairsJump()
|
||||
noremap <buffer> <silent> <M-p> :call AutoPairsToggle()
|
||||
inoremap <buffer> <silent> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> =AutoPairsFastWrap()
|
||||
inoremap <buffer> <silent> =AutoPairsSpace()
|
||||
inoremap <buffer> <silent> " =AutoPairsInsert('"')
|
||||
inoremap <buffer> <silent> ' =AutoPairsInsert('''')
|
||||
inoremap <buffer> <silent> ( =AutoPairsInsert('(')
|
||||
inoremap <buffer> <silent> ) =AutoPairsInsert(')')
|
||||
noremap <buffer> <silent> î :call AutoPairsJump()
|
||||
noremap <buffer> <silent> ð :call AutoPairsToggle()
|
||||
inoremap <buffer> <silent> [ =AutoPairsInsert('[')
|
||||
inoremap <buffer> <silent> ] =AutoPairsInsert(']')
|
||||
inoremap <buffer> <silent> ` =AutoPairsInsert('`')
|
||||
inoremap <buffer> <silent> { =AutoPairsInsert('{')
|
||||
inoremap <buffer> <silent> } =AutoPairsInsert('}')
|
||||
let &cpo=s:cpo_save
|
||||
unlet s:cpo_save
|
||||
setlocal autoindent
|
||||
setlocal backupcopy=
|
||||
setlocal nobinary
|
||||
setlocal nobreakindent
|
||||
setlocal breakindentopt=
|
||||
setlocal bufhidden=
|
||||
setlocal buflisted
|
||||
setlocal buftype=
|
||||
setlocal nocindent
|
||||
setlocal cinkeys=0{,0},0),0],:,!^F,o,O,e
|
||||
setlocal cinoptions=
|
||||
setlocal cinwords=if,else,while,do,for,switch
|
||||
set colorcolumn=80
|
||||
setlocal colorcolumn=80
|
||||
setlocal comments=b:#,fb:-
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal complete=.,w,b,u,t,i
|
||||
setlocal completefunc=
|
||||
setlocal nocopyindent
|
||||
setlocal cryptmethod=
|
||||
setlocal nocursorbind
|
||||
setlocal nocursorcolumn
|
||||
setlocal nocursorline
|
||||
setlocal cursorlineopt=both
|
||||
setlocal define=
|
||||
setlocal dictionary=
|
||||
setlocal nodiff
|
||||
setlocal equalprg=
|
||||
setlocal errorformat=
|
||||
setlocal expandtab
|
||||
if &filetype != 'python'
|
||||
setlocal filetype=python
|
||||
endif
|
||||
setlocal fixendofline
|
||||
setlocal foldcolumn=0
|
||||
set nofoldenable
|
||||
setlocal nofoldenable
|
||||
setlocal foldexpr=0
|
||||
setlocal foldignore=#
|
||||
setlocal foldlevel=0
|
||||
setlocal foldmarker={{{,}}}
|
||||
set foldmethod=indent
|
||||
setlocal foldmethod=indent
|
||||
setlocal foldminlines=1
|
||||
setlocal foldnestmax=20
|
||||
setlocal foldtext=foldtext()
|
||||
setlocal formatexpr=
|
||||
setlocal formatoptions=tcq
|
||||
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
|
||||
setlocal formatprg=
|
||||
setlocal grepprg=
|
||||
setlocal iminsert=0
|
||||
setlocal imsearch=-1
|
||||
setlocal include=^\\s*\\(from\\|import\\)
|
||||
setlocal includeexpr=substitute(substitute(substitute(v:fname,b:grandparent_match,b:grandparent_sub,''),b:parent_match,b:parent_sub,''),b:child_match,b:child_sub,'g')
|
||||
setlocal indentexpr=GetPythonIndent(v:lnum)
|
||||
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,<:>,=elif,=except
|
||||
setlocal noinfercase
|
||||
setlocal iskeyword=@,48-57,_,192-255
|
||||
setlocal keywordprg=pydoc
|
||||
setlocal nolinebreak
|
||||
setlocal nolisp
|
||||
setlocal lispwords=
|
||||
setlocal nolist
|
||||
setlocal makeencoding=
|
||||
setlocal makeprg=
|
||||
setlocal matchpairs=(:),{:},[:]
|
||||
setlocal modeline
|
||||
setlocal modifiable
|
||||
setlocal nrformats=bin,octal,hex
|
||||
set number
|
||||
setlocal number
|
||||
setlocal numberwidth=4
|
||||
setlocal omnifunc=pythoncomplete#Complete
|
||||
setlocal path=
|
||||
setlocal nopreserveindent
|
||||
setlocal nopreviewwindow
|
||||
setlocal quoteescape=\\
|
||||
setlocal noreadonly
|
||||
setlocal norelativenumber
|
||||
setlocal noscrollbind
|
||||
setlocal scrolloff=-1
|
||||
setlocal shiftwidth=4
|
||||
setlocal noshortname
|
||||
setlocal showbreak=
|
||||
setlocal sidescrolloff=-1
|
||||
setlocal signcolumn=auto
|
||||
setlocal nosmartindent
|
||||
setlocal softtabstop=4
|
||||
set spell
|
||||
setlocal spell
|
||||
setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
|
||||
setlocal spellfile=
|
||||
setlocal spelllang=en
|
||||
setlocal statusline=%{lightline#link()}%#LightlineLeft_active_0#%(\ %{lightline#mode()}\ %)%{(&paste)?\"|\":\"\"}%(\ %{&paste?\"PASTE\":\"\"}\ %)%#LightlineLeft_active_0_1#%#LightlineLeft_active_1#%(\ %R\ %)%{(&readonly)&&(1||(&modified||!&modifiable))?\"|\":\"\"}%(\ %t\ %)%{(&modified||!&modifiable)?\"|\":\"\"}%(\ %M\ %)%#LightlineLeft_active_1_2#%#LightlineMiddle_active#%=%#LightlineRight_active_2_3#%#LightlineRight_active_2#%(\ %{&ff}\ %)%{1||1?\"|\":\"\"}%(\ %{&fenc!=#\"\"?&fenc:&enc}\ %)%{1?\"|\":\"\"}%(\ %{&ft!=#\"\"?&ft:\"no\ ft\"}\ %)%#LightlineRight_active_1_2#%#LightlineRight_active_1#%(\ %3p%%\ %)%#LightlineRight_active_0_1#%#LightlineRight_active_0#%(\ %3l:%-2c\ %)
|
||||
setlocal suffixesadd=.py
|
||||
setlocal noswapfile
|
||||
setlocal synmaxcol=3000
|
||||
if &syntax != 'python'
|
||||
setlocal syntax=python
|
||||
endif
|
||||
setlocal tabstop=8
|
||||
setlocal tagcase=
|
||||
setlocal tagfunc=
|
||||
setlocal tags=
|
||||
setlocal termwinkey=
|
||||
setlocal termwinscroll=10000
|
||||
setlocal termwinsize=
|
||||
setlocal textwidth=0
|
||||
setlocal thesaurus=
|
||||
setlocal noundofile
|
||||
setlocal undolevels=-123456
|
||||
setlocal wincolor=
|
||||
setlocal nowinfixheight
|
||||
setlocal nowinfixwidth
|
||||
set nowrap
|
||||
setlocal nowrap
|
||||
setlocal wrapmargin=0
|
||||
let s:l = 83 - ((21 * winheight(0) + 21) / 43)
|
||||
if s:l < 1 | let s:l = 1 | endif
|
||||
exe s:l
|
||||
normal! zt
|
||||
83
|
||||
normal! 05|
|
||||
wincmd w
|
||||
argglobal
|
||||
if bufexists("gita/__main__.py") | buffer gita/__main__.py | else | edit gita/__main__.py | endif
|
||||
let s:cpo_save=&cpo
|
||||
set cpo&vim
|
||||
inoremap <buffer> <silent> <M-n> :call AutoPairsJump()
a
|
||||
inoremap <buffer> <silent> <expr> <M-p> AutoPairsToggle()
|
||||
inoremap <buffer> <silent> <M-b> =AutoPairsBackInsert()
|
||||
inoremap <buffer> <silent> <C-W> =AutoPairsFastWrap()
|
||||
inoremap <buffer> <silent> <C-H> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> <BS> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> <M-'> =AutoPairsMoveCharacter('''')
|
||||
inoremap <buffer> <silent> <M-"> =AutoPairsMoveCharacter('"')
|
||||
inoremap <buffer> <silent> <M-}> =AutoPairsMoveCharacter('}')
|
||||
inoremap <buffer> <silent> <M-{> =AutoPairsMoveCharacter('{')
|
||||
inoremap <buffer> <silent> <M-]> =AutoPairsMoveCharacter(']')
|
||||
inoremap <buffer> <silent> <M-[> =AutoPairsMoveCharacter('[')
|
||||
inoremap <buffer> <silent> <M-)> =AutoPairsMoveCharacter(')')
|
||||
inoremap <buffer> <silent> <M-(> =AutoPairsMoveCharacter('(')
|
||||
nmap <buffer> ,hp <Plug>(GitGutterPreviewHunk)
|
||||
nmap <buffer> ,hu <Plug>(GitGutterUndoHunk)
|
||||
nmap <buffer> ,hs <Plug>(GitGutterStageHunk)
|
||||
xmap <buffer> ,hs <Plug>(GitGutterStageHunk)
|
||||
inoremap <buffer> <silent> § =AutoPairsMoveCharacter('''')
|
||||
inoremap <buffer> <silent> ¢ =AutoPairsMoveCharacter('"')
|
||||
inoremap <buffer> <silent> © =AutoPairsMoveCharacter(')')
|
||||
inoremap <buffer> <silent> ¨ =AutoPairsMoveCharacter('(')
|
||||
inoremap <buffer> <silent> î :call AutoPairsJump()
a
|
||||
inoremap <buffer> <silent> <expr> ð AutoPairsToggle()
|
||||
inoremap <buffer> <silent> â =AutoPairsBackInsert()
|
||||
inoremap <buffer> <silent> ý =AutoPairsMoveCharacter('}')
|
||||
inoremap <buffer> <silent> û =AutoPairsMoveCharacter('{')
|
||||
inoremap <buffer> <silent> Ý =AutoPairsMoveCharacter(']')
|
||||
inoremap <buffer> <silent> Û =AutoPairsMoveCharacter('[')
|
||||
nmap <buffer> [c <Plug>(GitGutterPrevHunk)
|
||||
nmap <buffer> ]c <Plug>(GitGutterNextHunk)
|
||||
xmap <buffer> ac <Plug>(GitGutterTextObjectOuterVisual)
|
||||
omap <buffer> ac <Plug>(GitGutterTextObjectOuterPending)
|
||||
xmap <buffer> ic <Plug>(GitGutterTextObjectInnerVisual)
|
||||
omap <buffer> ic <Plug>(GitGutterTextObjectInnerPending)
|
||||
noremap <buffer> <silent> <M-n> :call AutoPairsJump()
|
||||
noremap <buffer> <silent> <M-p> :call AutoPairsToggle()
|
||||
inoremap <buffer> <silent> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> =AutoPairsFastWrap()
|
||||
inoremap <buffer> <silent> =AutoPairsSpace()
|
||||
inoremap <buffer> <silent> " =AutoPairsInsert('"')
|
||||
inoremap <buffer> <silent> ' =AutoPairsInsert('''')
|
||||
inoremap <buffer> <silent> ( =AutoPairsInsert('(')
|
||||
inoremap <buffer> <silent> ) =AutoPairsInsert(')')
|
||||
noremap <buffer> <silent> î :call AutoPairsJump()
|
||||
noremap <buffer> <silent> ð :call AutoPairsToggle()
|
||||
inoremap <buffer> <silent> [ =AutoPairsInsert('[')
|
||||
inoremap <buffer> <silent> ] =AutoPairsInsert(']')
|
||||
inoremap <buffer> <silent> ` =AutoPairsInsert('`')
|
||||
inoremap <buffer> <silent> { =AutoPairsInsert('{')
|
||||
inoremap <buffer> <silent> } =AutoPairsInsert('}')
|
||||
let &cpo=s:cpo_save
|
||||
unlet s:cpo_save
|
||||
setlocal autoindent
|
||||
setlocal backupcopy=
|
||||
setlocal nobinary
|
||||
setlocal nobreakindent
|
||||
setlocal breakindentopt=
|
||||
setlocal bufhidden=
|
||||
setlocal buflisted
|
||||
setlocal buftype=
|
||||
setlocal nocindent
|
||||
setlocal cinkeys=0{,0},0),0],:,!^F,o,O,e
|
||||
setlocal cinoptions=
|
||||
setlocal cinwords=if,else,while,do,for,switch
|
||||
set colorcolumn=0
|
||||
setlocal colorcolumn=0
|
||||
setlocal comments=b:#,fb:-
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal complete=.,w,b,u,t,i
|
||||
setlocal completefunc=
|
||||
setlocal nocopyindent
|
||||
setlocal cryptmethod=
|
||||
setlocal nocursorbind
|
||||
setlocal nocursorcolumn
|
||||
setlocal nocursorline
|
||||
setlocal cursorlineopt=both
|
||||
setlocal define=
|
||||
setlocal dictionary=
|
||||
setlocal nodiff
|
||||
setlocal equalprg=
|
||||
setlocal errorformat=
|
||||
setlocal expandtab
|
||||
if &filetype != 'python'
|
||||
setlocal filetype=python
|
||||
endif
|
||||
setlocal fixendofline
|
||||
setlocal foldcolumn=0
|
||||
set nofoldenable
|
||||
setlocal nofoldenable
|
||||
setlocal foldexpr=0
|
||||
setlocal foldignore=#
|
||||
setlocal foldlevel=0
|
||||
setlocal foldmarker={{{,}}}
|
||||
set foldmethod=indent
|
||||
setlocal foldmethod=indent
|
||||
setlocal foldminlines=1
|
||||
setlocal foldnestmax=20
|
||||
setlocal foldtext=foldtext()
|
||||
setlocal formatexpr=
|
||||
setlocal formatoptions=tcq
|
||||
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
|
||||
setlocal formatprg=
|
||||
setlocal grepprg=
|
||||
setlocal iminsert=0
|
||||
setlocal imsearch=-1
|
||||
setlocal include=^\\s*\\(from\\|import\\)
|
||||
setlocal includeexpr=substitute(substitute(substitute(v:fname,b:grandparent_match,b:grandparent_sub,''),b:parent_match,b:parent_sub,''),b:child_match,b:child_sub,'g')
|
||||
setlocal indentexpr=GetPythonIndent(v:lnum)
|
||||
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,<:>,=elif,=except
|
||||
setlocal noinfercase
|
||||
setlocal iskeyword=@,48-57,_,192-255
|
||||
setlocal keywordprg=pydoc
|
||||
setlocal nolinebreak
|
||||
setlocal nolisp
|
||||
setlocal lispwords=
|
||||
setlocal nolist
|
||||
setlocal makeencoding=
|
||||
setlocal makeprg=
|
||||
setlocal matchpairs=(:),{:},[:]
|
||||
setlocal modeline
|
||||
setlocal modifiable
|
||||
setlocal nrformats=bin,octal,hex
|
||||
set number
|
||||
setlocal number
|
||||
setlocal numberwidth=4
|
||||
setlocal omnifunc=pythoncomplete#Complete
|
||||
setlocal path=
|
||||
setlocal nopreserveindent
|
||||
setlocal nopreviewwindow
|
||||
setlocal quoteescape=\\
|
||||
setlocal noreadonly
|
||||
setlocal norelativenumber
|
||||
setlocal noscrollbind
|
||||
setlocal scrolloff=-1
|
||||
setlocal shiftwidth=4
|
||||
setlocal noshortname
|
||||
setlocal showbreak=
|
||||
setlocal sidescrolloff=-1
|
||||
setlocal signcolumn=auto
|
||||
setlocal nosmartindent
|
||||
setlocal softtabstop=4
|
||||
set spell
|
||||
setlocal spell
|
||||
setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
|
||||
setlocal spellfile=
|
||||
setlocal spelllang=en
|
||||
setlocal statusline=%{lightline#link()}%#LightlineLeft_inactive_0#%(\ %t\ %)%#LightlineLeft_inactive_0_1#%#LightlineMiddle_inactive#%=%#LightlineRight_inactive_1_2#%#LightlineRight_inactive_1#%(\ %3p%%\ %)%#LightlineRight_inactive_0_1#%#LightlineRight_inactive_0#%(\ %3l:%-2c\ %)
|
||||
setlocal suffixesadd=.py
|
||||
setlocal noswapfile
|
||||
setlocal synmaxcol=3000
|
||||
if &syntax != 'python'
|
||||
setlocal syntax=python
|
||||
endif
|
||||
setlocal tabstop=8
|
||||
setlocal tagcase=
|
||||
setlocal tagfunc=
|
||||
setlocal tags=
|
||||
setlocal termwinkey=
|
||||
setlocal termwinscroll=10000
|
||||
setlocal termwinsize=
|
||||
setlocal textwidth=0
|
||||
setlocal thesaurus=
|
||||
setlocal noundofile
|
||||
setlocal undolevels=-123456
|
||||
setlocal wincolor=
|
||||
setlocal nowinfixheight
|
||||
setlocal nowinfixwidth
|
||||
set nowrap
|
||||
setlocal nowrap
|
||||
setlocal wrapmargin=0
|
||||
let s:l = 34 - ((32 * winheight(0) + 21) / 43)
|
||||
if s:l < 1 | let s:l = 1 | endif
|
||||
exe s:l
|
||||
normal! zt
|
||||
34
|
||||
normal! 09|
|
||||
wincmd w
|
||||
exe 'vert 1resize ' . ((&columns * 94 + 94) / 188)
|
||||
exe 'vert 2resize ' . ((&columns * 93 + 94) / 188)
|
||||
tabnext
|
||||
edit gita/common.py
|
||||
set splitbelow splitright
|
||||
set nosplitbelow
|
||||
set nosplitright
|
||||
wincmd t
|
||||
set winminheight=0
|
||||
set winheight=1
|
||||
set winminwidth=0
|
||||
set winwidth=1
|
||||
argglobal
|
||||
let s:cpo_save=&cpo
|
||||
set cpo&vim
|
||||
inoremap <buffer> <silent> <M-n> :call AutoPairsJump()
a
|
||||
inoremap <buffer> <silent> <expr> <M-p> AutoPairsToggle()
|
||||
inoremap <buffer> <silent> <M-b> =AutoPairsBackInsert()
|
||||
inoremap <buffer> <silent> <C-W> =AutoPairsFastWrap()
|
||||
inoremap <buffer> <silent> <C-H> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> <BS> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> <M-'> =AutoPairsMoveCharacter('''')
|
||||
inoremap <buffer> <silent> <M-"> =AutoPairsMoveCharacter('"')
|
||||
inoremap <buffer> <silent> <M-}> =AutoPairsMoveCharacter('}')
|
||||
inoremap <buffer> <silent> <M-{> =AutoPairsMoveCharacter('{')
|
||||
inoremap <buffer> <silent> <M-]> =AutoPairsMoveCharacter(']')
|
||||
inoremap <buffer> <silent> <M-[> =AutoPairsMoveCharacter('[')
|
||||
inoremap <buffer> <silent> <M-)> =AutoPairsMoveCharacter(')')
|
||||
inoremap <buffer> <silent> <M-(> =AutoPairsMoveCharacter('(')
|
||||
nmap <buffer> ,hp <Plug>(GitGutterPreviewHunk)
|
||||
nmap <buffer> ,hu <Plug>(GitGutterUndoHunk)
|
||||
nmap <buffer> ,hs <Plug>(GitGutterStageHunk)
|
||||
xmap <buffer> ,hs <Plug>(GitGutterStageHunk)
|
||||
inoremap <buffer> <silent> § =AutoPairsMoveCharacter('''')
|
||||
inoremap <buffer> <silent> ¢ =AutoPairsMoveCharacter('"')
|
||||
inoremap <buffer> <silent> © =AutoPairsMoveCharacter(')')
|
||||
inoremap <buffer> <silent> ¨ =AutoPairsMoveCharacter('(')
|
||||
inoremap <buffer> <silent> î :call AutoPairsJump()
a
|
||||
inoremap <buffer> <silent> <expr> ð AutoPairsToggle()
|
||||
inoremap <buffer> <silent> â =AutoPairsBackInsert()
|
||||
inoremap <buffer> <silent> ý =AutoPairsMoveCharacter('}')
|
||||
inoremap <buffer> <silent> û =AutoPairsMoveCharacter('{')
|
||||
inoremap <buffer> <silent> Ý =AutoPairsMoveCharacter(']')
|
||||
inoremap <buffer> <silent> Û =AutoPairsMoveCharacter('[')
|
||||
nmap <buffer> [c <Plug>(GitGutterPrevHunk)
|
||||
nmap <buffer> ]c <Plug>(GitGutterNextHunk)
|
||||
xmap <buffer> ac <Plug>(GitGutterTextObjectOuterVisual)
|
||||
omap <buffer> ac <Plug>(GitGutterTextObjectOuterPending)
|
||||
xmap <buffer> ic <Plug>(GitGutterTextObjectInnerVisual)
|
||||
omap <buffer> ic <Plug>(GitGutterTextObjectInnerPending)
|
||||
noremap <buffer> <silent> <M-n> :call AutoPairsJump()
|
||||
noremap <buffer> <silent> <M-p> :call AutoPairsToggle()
|
||||
inoremap <buffer> <silent> =AutoPairsDelete()
|
||||
inoremap <buffer> <silent> =AutoPairsFastWrap()
|
||||
inoremap <buffer> <silent> =AutoPairsSpace()
|
||||
inoremap <buffer> <silent> " =AutoPairsInsert('"')
|
||||
inoremap <buffer> <silent> ' =AutoPairsInsert('''')
|
||||
inoremap <buffer> <silent> ( =AutoPairsInsert('(')
|
||||
inoremap <buffer> <silent> ) =AutoPairsInsert(')')
|
||||
noremap <buffer> <silent> î :call AutoPairsJump()
|
||||
noremap <buffer> <silent> ð :call AutoPairsToggle()
|
||||
inoremap <buffer> <silent> [ =AutoPairsInsert('[')
|
||||
inoremap <buffer> <silent> ] =AutoPairsInsert(']')
|
||||
inoremap <buffer> <silent> ` =AutoPairsInsert('`')
|
||||
inoremap <buffer> <silent> { =AutoPairsInsert('{')
|
||||
inoremap <buffer> <silent> } =AutoPairsInsert('}')
|
||||
let &cpo=s:cpo_save
|
||||
unlet s:cpo_save
|
||||
setlocal autoindent
|
||||
setlocal backupcopy=
|
||||
setlocal nobinary
|
||||
setlocal nobreakindent
|
||||
setlocal breakindentopt=
|
||||
setlocal bufhidden=
|
||||
setlocal buflisted
|
||||
setlocal buftype=
|
||||
setlocal nocindent
|
||||
setlocal cinkeys=0{,0},0),0],:,!^F,o,O,e
|
||||
setlocal cinoptions=
|
||||
setlocal cinwords=if,else,while,do,for,switch
|
||||
set colorcolumn=0
|
||||
setlocal colorcolumn=0
|
||||
setlocal comments=b:#,fb:-
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal complete=.,w,b,u,t,i
|
||||
setlocal completefunc=
|
||||
setlocal nocopyindent
|
||||
setlocal cryptmethod=
|
||||
setlocal nocursorbind
|
||||
setlocal nocursorcolumn
|
||||
setlocal nocursorline
|
||||
setlocal cursorlineopt=both
|
||||
setlocal define=
|
||||
setlocal dictionary=
|
||||
setlocal nodiff
|
||||
setlocal equalprg=
|
||||
setlocal errorformat=
|
||||
setlocal expandtab
|
||||
if &filetype != 'python'
|
||||
setlocal filetype=python
|
||||
endif
|
||||
setlocal fixendofline
|
||||
setlocal foldcolumn=0
|
||||
set nofoldenable
|
||||
setlocal nofoldenable
|
||||
setlocal foldexpr=0
|
||||
setlocal foldignore=#
|
||||
setlocal foldlevel=0
|
||||
setlocal foldmarker={{{,}}}
|
||||
set foldmethod=indent
|
||||
setlocal foldmethod=indent
|
||||
setlocal foldminlines=1
|
||||
setlocal foldnestmax=20
|
||||
setlocal foldtext=foldtext()
|
||||
setlocal formatexpr=
|
||||
setlocal formatoptions=tcq
|
||||
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
|
||||
setlocal formatprg=
|
||||
setlocal grepprg=
|
||||
setlocal iminsert=0
|
||||
setlocal imsearch=-1
|
||||
setlocal include=^\\s*\\(from\\|import\\)
|
||||
setlocal includeexpr=substitute(substitute(substitute(v:fname,b:grandparent_match,b:grandparent_sub,''),b:parent_match,b:parent_sub,''),b:child_match,b:child_sub,'g')
|
||||
setlocal indentexpr=GetPythonIndent(v:lnum)
|
||||
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,<:>,=elif,=except
|
||||
setlocal noinfercase
|
||||
setlocal iskeyword=@,48-57,_,192-255
|
||||
setlocal keywordprg=pydoc
|
||||
setlocal nolinebreak
|
||||
setlocal nolisp
|
||||
setlocal lispwords=
|
||||
setlocal nolist
|
||||
setlocal makeencoding=
|
||||
setlocal makeprg=
|
||||
setlocal matchpairs=(:),{:},[:]
|
||||
setlocal modeline
|
||||
setlocal modifiable
|
||||
setlocal nrformats=bin,octal,hex
|
||||
set number
|
||||
setlocal number
|
||||
setlocal numberwidth=4
|
||||
setlocal omnifunc=pythoncomplete#Complete
|
||||
setlocal path=
|
||||
setlocal nopreserveindent
|
||||
setlocal nopreviewwindow
|
||||
setlocal quoteescape=\\
|
||||
setlocal noreadonly
|
||||
setlocal norelativenumber
|
||||
setlocal noscrollbind
|
||||
setlocal scrolloff=-1
|
||||
setlocal shiftwidth=4
|
||||
setlocal noshortname
|
||||
setlocal showbreak=
|
||||
setlocal sidescrolloff=-1
|
||||
setlocal signcolumn=auto
|
||||
setlocal nosmartindent
|
||||
setlocal softtabstop=4
|
||||
set spell
|
||||
setlocal spell
|
||||
setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
|
||||
setlocal spellfile=
|
||||
setlocal spelllang=en
|
||||
setlocal statusline=%{lightline#link()}%#LightlineLeft_active_0#%(\ %{lightline#mode()}\ %)%{(&paste)?\"|\":\"\"}%(\ %{&paste?\"PASTE\":\"\"}\ %)%#LightlineLeft_active_0_1#%#LightlineLeft_active_1#%(\ %R\ %)%{(&readonly)&&(1||(&modified||!&modifiable))?\"|\":\"\"}%(\ %t\ %)%{(&modified||!&modifiable)?\"|\":\"\"}%(\ %M\ %)%#LightlineLeft_active_1_2#%#LightlineMiddle_active#%=%#LightlineRight_active_2_3#%#LightlineRight_active_2#%(\ %{&ff}\ %)%{1||1?\"|\":\"\"}%(\ %{&fenc!=#\"\"?&fenc:&enc}\ %)%{1?\"|\":\"\"}%(\ %{&ft!=#\"\"?&ft:\"no\ ft\"}\ %)%#LightlineRight_active_1_2#%#LightlineRight_active_1#%(\ %3p%%\ %)%#LightlineRight_active_0_1#%#LightlineRight_active_0#%(\ %3l:%-2c\ %)
|
||||
setlocal suffixesadd=.py
|
||||
setlocal noswapfile
|
||||
setlocal synmaxcol=3000
|
||||
if &syntax != 'python'
|
||||
setlocal syntax=python
|
||||
endif
|
||||
setlocal tabstop=8
|
||||
setlocal tagcase=
|
||||
setlocal tagfunc=
|
||||
setlocal tags=
|
||||
setlocal termwinkey=
|
||||
setlocal termwinscroll=10000
|
||||
setlocal termwinsize=
|
||||
setlocal textwidth=0
|
||||
setlocal thesaurus=
|
||||
setlocal noundofile
|
||||
setlocal undolevels=-123456
|
||||
setlocal wincolor=
|
||||
setlocal nowinfixheight
|
||||
setlocal nowinfixwidth
|
||||
set nowrap
|
||||
setlocal nowrap
|
||||
setlocal wrapmargin=0
|
||||
let s:l = 2 - ((1 * winheight(0) + 21) / 43)
|
||||
if s:l < 1 | let s:l = 1 | endif
|
||||
exe s:l
|
||||
normal! zt
|
||||
2
|
||||
normal! 0
|
||||
tabnext 1
|
||||
set stal=1
|
||||
badd +34 gita/__main__.py
|
||||
badd +0 gita/utils.py
|
||||
badd +0 gita/common.py
|
||||
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0
|
||||
silent exe 'bwipe ' . s:wipebuf
|
||||
endif
|
||||
unlet! s:wipebuf
|
||||
set winheight=1 winwidth=20 shortmess=filnxtToOS
|
||||
set winminheight=1 winminwidth=1
|
||||
let s:sx = expand("<sfile>:p:r")."x.vim"
|
||||
if filereadable(s:sx)
|
||||
exe "source " . fnameescape(s:sx)
|
||||
endif
|
||||
let &so = s:so_save | let &siso = s:siso_save
|
||||
nohlsearch
|
||||
doautoall SessionLoadPost
|
||||
unlet SessionLoad
|
||||
" vim: set ft=vim :
|
Loading…
Add table
Add a link
Reference in a new issue