]> git.wincent.com - wincent.git/log
wincent.git
2 years agorefactor(fig): set up path alias for "fig" -> "src"
Greg Hurrell [Tue, 21 Apr 2020 22:13:19 +0000 (00:13 +0200)] 
refactor(fig): set up path alias for "fig" -> "src"

This enables `tsc` to find modules from aspects like so:

    import '../../src/something.js';

instead of:

    import 'fig/something.js';

Normally I hate this kind of path hacking and aliasing because it
obfuscates where things really are.

But in this case aspects are supposed to be a DSL and somehow special.
"gd" in Vim still takes you to the right file (ie. via the LSP server).
Note that "gf" doesn't work after this change, and it didn't work before
it either, because when you are looking at "something.js", you actually
want to go to the source, which is "something.ts". So, "gd" works, but
"gf" doesn't.

2 years agorefactor(fig): move wrappers for POSIX utilities into posix/
Greg Hurrell [Tue, 21 Apr 2020 21:28:15 +0000 (23:28 +0200)] 
refactor(fig): move wrappers for POSIX utilities into posix/

2 years agofeat(fig): add --dry-run switch
Greg Hurrell [Tue, 21 Apr 2020 17:35:03 +0000 (19:35 +0200)] 
feat(fig): add --dry-run switch

2 years agorefactor(fig)!: replace `install` with `install-next`
Greg Hurrell [Tue, 21 Apr 2020 16:43:50 +0000 (18:43 +0200)] 
refactor(fig)!: replace `install` with `install-next`

`install` becomes `install-legacy`.

Because I am running `install-next` more often now (and we are still on
the "pu" branch at the time I write this, so I am not worried about
anybody coming in and using this unfinished software by accident).

2 years agochore(fig): update @types/node
Greg Hurrell [Tue, 21 Apr 2020 16:39:40 +0000 (18:39 +0200)] 
chore(fig): update @types/node

With `yarn add @types/node@*`.

2 years agochore(fig): get rid of --no-warnings
Greg Hurrell [Tue, 21 Apr 2020 16:36:52 +0000 (18:36 +0200)] 
chore(fig): get rid of --no-warnings

No longer needed because Node v14.0.0 just came out:

https://github.com/nodejs/node/pull/31974

2 years agodocs(portool): add notes about how to really override session.timeout
Greg Hurrell [Tue, 21 Apr 2020 16:25:22 +0000 (18:25 +0200)] 
docs(portool): add notes about how to really override session.timeout

2 years agodocs(fig): tweak README
Greg Hurrell [Tue, 21 Apr 2020 16:23:16 +0000 (18:23 +0200)] 
docs(fig): tweak README

2 years agofix: don't let Prettier mess with /python directory
Greg Hurrell [Tue, 21 Apr 2020 16:22:50 +0000 (18:22 +0200)] 
fix: don't let Prettier mess with /python directory

2 years agofix(fig): correct typo in path
Greg Hurrell [Mon, 20 Apr 2020 23:40:55 +0000 (01:40 +0200)] 
fix(fig): correct typo in path

2 years agorefactor(fig): get rid of useless index.ts files
Greg Hurrell [Mon, 20 Apr 2020 23:02:32 +0000 (01:02 +0200)] 
refactor(fig): get rid of useless index.ts files

These used to make sense when we could import "console/index.js" with:

    import {log} from 'console';

but with the move to ES6 module output, we have to do this:

    import {log} from 'console/index.js';

which is decidedly less pleasant.

2 years agofix(fig): deal with chdir being String
Greg Hurrell [Mon, 20 Apr 2020 22:53:06 +0000 (00:53 +0200)] 
fix(fig): deal with chdir being String

Because, surprise, surprise, Nodes child_process API will complain with
this beautiful error:

    TypeError [ERR_INVALID_ARG_TYPE]: The "options.cwd" property must be
    of type string. Received an instance of String

2 years agochore: sort .gitmodules
Greg Hurrell [Mon, 20 Apr 2020 22:43:25 +0000 (00:43 +0200)] 
chore: sort .gitmodules

It's been a while. Same trick as 399bf129367a3ecbb7d, as described in:

https://wincent.com/wiki/Sorting_.gitmodules_entries_with_Vim

ie:

```
:%s/\v\n\t/@@@/
:%sort
:%s/\v\@\@\@/\r\t/g
```

2 years agorefactor(fig): move most Vim config into "vim" aspect
Greg Hurrell [Mon, 20 Apr 2020 22:41:51 +0000 (00:41 +0200)] 
refactor(fig): move most Vim config into "vim" aspect

2 years agorefactor(fig): stub out "vim" aspects
Greg Hurrell [Mon, 20 Apr 2020 19:52:20 +0000 (21:52 +0200)] 
refactor(fig): stub out "vim" aspects

Doesn't actually do anything useful yet, which is why I am labeling this
as "refactor".

2 years agorefactor(fig): port .zshenv, code/.editorconfig over to Fig
Greg Hurrell [Mon, 20 Apr 2020 19:46:09 +0000 (21:46 +0200)] 
refactor(fig): port .zshenv, code/.editorconfig over to Fig

2 years agofix(vim): get Vim plugins working again
Greg Hurrell [Mon, 20 Apr 2020 10:07:55 +0000 (12:07 +0200)] 
fix(vim): get Vim plugins working again

Root cause: symlink in home directory wasn't getting replaced due to
missing `-n` flag, so when I updated, `~/.vim` continued to point at
`~/code/wincent/roles/dotfiles/files/.vim` instead of the new location
(`~/code/wincent/aspects/dotfiles/files/.vim`).

I fixed that, but some other things were broken, so I tried an update,
which in turn broke more things (eg. deoplete now depends on msgpack
1.0.0). In the end though, I think everything is basically working now.

Here are the submodule updates that I didn't necessarily need/want but
which I got anyway:

* aspects/dotfiles/files/.vim/pack/bundle/opt/LanguageClient-neovim 04bdd56...18434f2 (28):
  > (cargo-release) version 0.1.157
  > Adjust pulling tags in CI
  > Fix compiling for Windows
  > Fix default diagnostic severity
  > Update release process
  > Update CHANGELOG
  > Fix issue sign is not cleared up
  > init b:LanguageClient_isServerRunning only when not defined yet.
  > new function LanguageClient#statusLineDiagnosticsCounts (#1006)
  > new function LanguageClient#isServerRunning() for statusline integration (#1003)
  > Create Logger struct
  > Fix clippy warnings
  > Cleanup codeLens code
  > Use AtomicU64 for RpcClient::id
  > Fix clippy complaints
  > Add option to set preferred MarkupKind and send that to the server
  > Show code lenses in fzf
  > chore(docs): ensure each header and code block are separated from other content by a newline
  > chore(docs): use unordered list items instead of numbered lists
  > chore(docs): remove numbers from section headers
  > feat(docs): add installation instructions for arch linux
  > make command arguments optional
  > Add default root path implementation for Go
  > Add LanguageClient_applyCompletionAdditionalTextEdits flag.
  > Update CHANGLOG
  > Upgrade and lint Dockerfile using hadolint
  > Update cursor position after applying text edits (#961)
  > Add support for the proposed Semantic Highlighting Protocol (#954)

* aspects/dotfiles/files/.vim/pack/bundle/opt/deoplete 6e01000...bbec852 (40):
  > Fix #174 check virtualcol()
  > Set context vars in on_event
  > Fix close popup error when skipped text
  > Add rubycomplete as omnifunc blacklist
  > Merge branch 'master' of github.com:Shougo/deoplete.nvim
  > Close the popup if skipped
  > Remove eskk check
  > Fix #1090 improve close popup
  > Improve sorter_rank
  > Fix eskk conflict
  > Improve changedtick
  > Update
  > Fix Makefile
  > Fix popup close problem
  > Check popup state
  > Add modifiable check
  > Fix #1085 implement locality in sorter_rank
  > Add completeopt check in omni_patterns feature
  > Fix #1086 auto update problem
  > Update the documentation
  > Fix lint errors
  > Merge pull request #1080 from shananton/doc-source-file-fix
  > Fix complete error
  > Fix auto_complete_popup problem
  > Fix auto_complete_popup manual
  > Fix complete_check error
  > Enable auto refresh when popup is displayed
  > Check g:deoplete#_context
  > Merge pull request #1078 from Shougo/old_msgpack
  > Update the documentation
  > Remove unnecessary message
  > Merge pull request #1076 from bouk/matcher-key-restore-all
  > Fix #1074 change version to 6.0
  > Improve msgpack version check
  > Improve for msgpack arguments
  > Improve health check
  > Merge pull request #1067 from Shougo/auto_complete_popup
  > Merge pull request #1070 from Shougo/msgpack
  > Merge pull request #1068 from Shougo/revert-1047-msgpack-remove_encoding_opt
  > Merge pull request #1047 from Shougo/msgpack-remove_encoding_opt

* aspects/dotfiles/files/.vim/pack/bundle/opt/float-preview.nvim c5431b6...3c2e230 (2):
  > Reset cursorcolumn
  > Reset colorcolumn

* aspects/dotfiles/files/.vim/pack/bundle/opt/indentLine bb548a9...15aceda (5):
  > Merge pull request #294 from Mike325/autoredraw
  > Cursor position is wrong on startup
  > fix issue #293 No such group or event: OptionSet diff call s:ToggleOnDiff()
  > fix issue #289
  > do not show indentLine if diff is set

* aspects/dotfiles/files/.vim/pack/bundle/opt/tcomment_vim 239c0c0...a20a34b (6):
  > FIX #265 NEW g:tcomment_map_modifier, g:tcomment_opmap_modifier: Configure use of <silent> etc.
  > FIX bib commentdef (use `if` condition proposed by enno)
  > Support for choose: Conditionally select a comment definition from a list of candidates (fixes https://github.com/tomtom/tcomment_vim/commit/0f94e969a14a0cd664ca67de38b640eaf54583ad?email_token=AAAJR5ACHF5PPVOR2JSULJDRD6UP3A5CNFSM4KF5DZ62YY3PNVWWK3TUL52HS4DFVVBW63LNNF2EG33NNVSW45FKMNXW23LFNZ2F62LEZYBDV5IA)
  > Merge pull request #256 from Chris-Slade/master
  > Merge pull request #261 from magnusmb/master
  > Merge pull request #262 from josa42/add-go-mod

* aspects/dotfiles/files/.vim/pack/bundle/opt/typescript-vim 616186f...17d85d8 (2):
  > Merge pull request #173 from jonsmithers/master
  > Merge pull request #176 from pappasam/INDENT_CORRECTLY_MULTILINE_GENERICS

* aspects/dotfiles/files/.vim/pack/bundle/opt/ultisnips 96026a4...ee31ea1 (6):
  > Fix typo in doc (#1197)
  > Fix identity check to content equality.
  > Feature: implement choices (#1172)
  > Send the correct trigger key to _handle_failure() (#1181)
  > Handle general case of MYVIMRC not being set in environment (#1173)
  > Remove unnecessary print (#1178)

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-dispatch 3757dda...fe6a343 (1):
  > Keep HOME env, or fish will raise warning

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-easydir 80f7fc2...2efbed9 (1):
  > Merge pull request #10 from xaizek/better-protocol-check

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-fugitive 4606640...85e2c73 (52):
  > Favor :Ggrep over :Git grep
  > Fix race condition resuming job after editor invocation
  > Encapsulate update-index --index-info
  > Leverage Git config retrieval helpers
  > Move Quickfix section under Git section
  > Fix typos in README
  > Drop support for :{windowheight}Git
  > Fix some inconsistencies in help mappings
  > Have remaining mappings use S:Map()
  > Rewrite feature summary in README
  > Factor in 8.2.0239 when checking for job env support
  > Enable closing stdin by pressing CTRL-D
  > Don't use "Head:" header for commit under cursor
  > Fix echoed line during :Gread
  > Fix list indexing bug
  > Fix staging hunk that comes after binary file
  > Use status headers for commit maps
  > Fix erroneous temp buffer on non-listing :Git branch
  > Support most top level Git options
  > Don't override alternate implementations of legacy commands
  > Don't rely on rebase --autosquash shorthand
  > Fix :GRename ../
  > Fix typo
  > Remove remaining :Gsubcmd calls from implementation
  > Fix internal documentation command references
  > Move :Ggrep docs near other :Gcommands
  > Remove redundant exists(':Gblame') check
  > Change subtopic help tag style from :Git- to :Git_
  > Fix deletion of trailing fold upon loading blob
  > Use :Gsubcmd completion for :Git subcmd
  > Remove most uses of s:EchoExec()
  > Remove old :Git! temp buffer behavior
  > Drop support for non-PTY :!
  > Override existing config values on :Git -c config.option=
  > Use :read for :{range}Git! --paginate
  > Tease apart bang and non-bang variants of :Gread
  > Remove erroneous :Gedit! deprecation
  > Handle custom Git executable for :Git --paginate
  > Update internal uses of :Git! to :Git --paginate
  > Use :pedit for :Git! --paginate
  > Add - map for Push header
  > Respect 'wildignorecase' when completing :Gedit
  > Pull out s:fileignorecase()
  > Refine handling of pagination via temp buffer
  > Correctly treat config keys without values as true
  > Deprecate :Gsplit! family in documentation
  > Quarantine deprecated commands in documentation
  > Work around minibufexpl/autochdir induced error
  > Fix Trailing Characters, Invalid range error for :<count>Gstatus
  > Add capitalized versions of non-standard commands
  > Partially support :Git difftool on old Git
  > Parameterize subcommand Git executable

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-javascript db59565...c396615 (1):
  > Fix matching of jsClassProperty without an initial value (#1202)

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-reason-plus 2d5a319...c11a294 (1):
  > Merge pull request #25 from AZanellato/reason-instead-of-rust

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-slime cf896c1...a811392 (6):
  > Merge pull request #238 from mdedonno1337/send_range_without_delimiters
  > Use diagram instead of ASCII art
  > Allow overrides with user-defined functions (#237)
  > Merge pull request #229 from menganha/cell_feature
  > Merge pull request #227 from jtcbrule/master
  > Merge pull request #225 from ynco/master

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-textobj-user 9861dc6...41a675d (1):
  > Add doc/tags to .gitignore

* aspects/dotfiles/files/.vim/pack/bundle/opt/vim-zsh a93252b...953535b (4):
  > README: fix saythanks link
  > fix ftplugin/zsh.vim header
  > Updated Makefile
  > Updated metadata. Will be send to Bram for inclusion with Vim

2 years agofeat(fig): support dynamic variables
Greg Hurrell [Sun, 19 Apr 2020 23:16:05 +0000 (01:16 +0200)] 
feat(fig): support dynamic variables

At two levels: global, and per-aspect. I think that should have us
covered. We don't want JSON to be anything but static so the two escape
hatches are:

- variables.ts (global).
- per-aspect `variables()` DSL.

2 years agofeat(fig): add variable.path and variable.paths helpers
Greg Hurrell [Sun, 19 Apr 2020 21:28:18 +0000 (23:28 +0200)] 
feat(fig): add variable.path and variable.paths helpers

2 years agorefactor(fig): convert to Path a little earlier
Greg Hurrell [Sun, 19 Apr 2020 21:19:33 +0000 (23:19 +0200)] 
refactor(fig): convert to Path a little earlier

To avoid repeated conversions later.

2 years agorefactor(fig): make path.aspect a getter
Greg Hurrell [Sun, 19 Apr 2020 21:11:17 +0000 (23:11 +0200)] 
refactor(fig): make path.aspect a getter

Although requires an ugly cast. Not sure why TS isn't picking up on the
defineProperty call.

2 years agofeat(fig): demo dotfile templating
Greg Hurrell [Sun, 19 Apr 2020 19:19:59 +0000 (21:19 +0200)] 
feat(fig): demo dotfile templating

Absurd example, seeing as I am using vim-corpus now instead of
Corpus.app, but it was low-hanging fruit.

Some TODOs noted inline.

2 years agorefactor(fig): get rid of a loop that wasn't pulling its weight
Greg Hurrell [Sun, 19 Apr 2020 16:16:10 +0000 (18:16 +0200)] 
refactor(fig): get rid of a loop that wasn't pulling its weight

2 years agorefactor: template alacritty directory instead of individual file
Greg Hurrell [Sun, 19 Apr 2020 16:13:25 +0000 (18:13 +0200)] 
refactor: template alacritty directory instead of individual file

2 years agorefactor(fig): clean up Path refactor
Greg Hurrell [Sun, 19 Apr 2020 15:54:46 +0000 (17:54 +0200)] 
refactor(fig): clean up Path refactor

2 years agorefactor(fig): marginally improve types
Greg Hurrell [Sun, 19 Apr 2020 15:47:06 +0000 (17:47 +0200)] 
refactor(fig): marginally improve types

2 years agorefactor(fig): add child_process wrapper
Greg Hurrell [Sun, 19 Apr 2020 15:29:47 +0000 (17:29 +0200)] 
refactor(fig): add child_process wrapper

Some nasty "any" casts though, that I'd like to get rid of.

2 years agorefactor(fig): add fs wrapper module
Greg Hurrell [Sun, 19 Apr 2020 15:09:11 +0000 (17:09 +0200)] 
refactor(fig): add fs wrapper module

2 years agorefactor(fig): extend "Path" usage
Greg Hurrell [Sun, 19 Apr 2020 12:59:12 +0000 (14:59 +0200)] 
refactor(fig): extend "Path" usage

Again, not sure if this is a good idea. Two smells to deal with:

- Quite a few `toString()` calls needed at various places to stop Node
  APIs from complaining about getting `String` instead of `string`.
- `path` is a super common name, and we are using it as a parameter name
  in some places, which means that I have to call it `toPath` to avoid a
  clash in some spots... Maybe I should just call it `toPath` everywhere
  for consistency, even though it is longer.

2 years agorefactor(fig): use Path string-like type
Greg Hurrell [Sun, 19 Apr 2020 12:01:32 +0000 (14:01 +0200)] 
refactor(fig): use Path string-like type

I might regret doing this, but the idea here is to replace code that
looks like:

    import {join, resolve} from 'path';

    const file = resource('a');
    const somePath = resolve(join(file, '..', 'x'));

with:

    const file = resource('a');
    const somePath = file.join('..', 'x').resolve();

Other examples in tests along the lines of:

    file.basename
    file.dirname
    file.resolve
    file.join('x')

I bet there are remaining bugs though; as you can see, I had to pepper
the code base with `toString()` calls before passing these to Node APIs
like `path.join()` because it complains with:

    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of
    type string. Received type object

Which is more annoying than anything else, to be honest, but it is what
it is... Sadly, type system here doesn't help us because these methods
take type "string", and my "Path" strings are that type...

2 years agorefactor(fig): manage most dotfiles with Fig
Greg Hurrell [Sun, 19 Apr 2020 00:49:29 +0000 (02:49 +0200)] 
refactor(fig): manage most dotfiles with Fig

2 years agofeat(vim): make it possibly to close floating preview with escape
Greg Hurrell [Sat, 18 Apr 2020 23:22:47 +0000 (01:22 +0200)] 
feat(vim): make it possibly to close floating preview with escape

2 years agofeat(fig): count skipped tasks
Greg Hurrell [Sat, 18 Apr 2020 21:59:24 +0000 (23:59 +0200)] 
feat(fig): count skipped tasks

Normally we report "ok", "skipped" etc at the level of individual
operations, but here we were skipping over entire tasks and not counting
anything; I think it's reasonable to count here, otherwise the summary
output at the end may be misleading (eg. if you run with `--step` and
say "n" to every task, it would report a skipped total of 0, which
doesn't make any sense).

2 years agofeat(fig): add --step support
Greg Hurrell [Sat, 18 Apr 2020 21:48:27 +0000 (23:48 +0200)] 
feat(fig): add --step support

2 years agofeat(fig): make seed of "dotfiles" aspect
Greg Hurrell [Sat, 18 Apr 2020 19:53:40 +0000 (21:53 +0200)] 
feat(fig): make seed of "dotfiles" aspect

2 years agorefactor(zsh): replace gradle-launcher with 10 lines of Bash
Greg Hurrell [Sat, 18 Apr 2020 19:33:21 +0000 (21:33 +0200)] 
refactor(zsh): replace gradle-launcher with 10 lines of Bash

2 years agochore: remove unused gh/gh-jira config
Greg Hurrell [Sat, 18 Apr 2020 19:15:36 +0000 (21:15 +0200)] 
chore: remove unused gh/gh-jira config

Haven't used this beyond trying it once or twice a year ago.

2 years agotest(fig): add `ln()` tests
Greg Hurrell [Sat, 18 Apr 2020 19:09:36 +0000 (21:09 +0200)] 
test(fig): add `ln()` tests

2 years agofeat(fig): basic support for linking
Greg Hurrell [Sat, 18 Apr 2020 17:39:57 +0000 (19:39 +0200)] 
feat(fig): basic support for linking

2 years agofeat(fig): support touching existing item
Greg Hurrell [Sat, 18 Apr 2020 16:22:52 +0000 (18:22 +0200)] 
feat(fig): support touching existing item

2 years agotest(fig): add directory tests
Greg Hurrell [Sat, 18 Apr 2020 16:03:21 +0000 (18:03 +0200)] 
test(fig): add directory tests

2 years agorefactor(fig): rationalize logging
Greg Hurrell [Sat, 18 Apr 2020 12:58:25 +0000 (14:58 +0200)] 
refactor(fig): rationalize logging

2 years agotest(fig): continue improving coverage
Greg Hurrell [Sat, 18 Apr 2020 12:39:38 +0000 (14:39 +0200)] 
test(fig): continue improving coverage

2 years agostyle(fig): run `yarn format`
Greg Hurrell [Sat, 18 Apr 2020 11:06:08 +0000 (13:06 +0200)] 
style(fig): run `yarn format`

2 years agorefactor(fig): make console function overloading work properly
Greg Hurrell [Sat, 18 Apr 2020 10:50:54 +0000 (12:50 +0200)] 
refactor(fig): make console function overloading work properly

Otherwise we can't do the non-template case.

2 years agofeat(fig): make prompts yellow because otherwise you might miss them
Greg Hurrell [Sat, 18 Apr 2020 10:42:14 +0000 (12:42 +0200)] 
feat(fig): make prompts yellow because otherwise you might miss them

2 years agorefactor(fig): externalize responsibility for specifying sudo requirement
Greg Hurrell [Sat, 18 Apr 2020 10:30:57 +0000 (12:30 +0200)] 
refactor(fig): externalize responsibility for specifying sudo requirement

I was getting carried away with the whole auto-sudo thing; it just
brings unwarranted complexity. If you want to manipulate something that
requires root privileges, you do it with an explicit `sudo: true`.

If you ever want to do something crazy like write a self-owned file into
a root-owned directory, you would do `{sudo: true, owner: 'blah'}`.

2 years agorefactor(fig): work in progress towards better "sudo" support
Greg Hurrell [Fri, 17 Apr 2020 22:49:13 +0000 (00:49 +0200)] 
refactor(fig): work in progress towards better "sudo" support

2 years agofix: use a valid SPDX license identifier in package.json
Greg Hurrell [Fri, 17 Apr 2020 19:51:46 +0000 (21:51 +0200)] 
fix: use a valid SPDX license identifier in package.json

As per:

https://docs.npmjs.com/files/package.json#license

Note that even though I called this "public domain", the actual text in
the LICENSE.md is in fact "The Unlicense":

https://spdx.org/licenses/Unlicense.html

which is pretty much the closest thing that we have to a standard way to
dedicate something to the public domain.

2 years agofeat(fig): make mode handling more general
Greg Hurrell [Fri, 17 Apr 2020 19:46:06 +0000 (21:46 +0200)] 
feat(fig): make mode handling more general

2 years agofeat(fig): wire up mode changes
Greg Hurrell [Fri, 17 Apr 2020 16:10:50 +0000 (18:10 +0200)] 
feat(fig): wire up mode changes

2 years agochore(vim): add "Firefox" to custom dictionary
Greg Hurrell [Fri, 17 Apr 2020 15:06:55 +0000 (17:06 +0200)] 
chore(vim): add "Firefox" to custom dictionary

2 years agochore(portool): add sample editor.wysiwyg property
Greg Hurrell [Thu, 16 Apr 2020 11:33:43 +0000 (13:33 +0200)] 
chore(portool): add sample editor.wysiwyg property

So that I don't have to look it up every time I want to change it. Note
that changing this is still a bit painful (because you have to run `:set
nomodifiable`) but at least it is straightforwardly possible.

2 years agochore(vim): add "Liferay" to custom dictionary
Greg Hurrell [Thu, 16 Apr 2020 11:31:29 +0000 (13:31 +0200)] 
chore(vim): add "Liferay" to custom dictionary

Surprised it wasn't in there already.

2 years agofeat(corpus): make it possible to create new files from search
Greg Hurrell [Wed, 15 Apr 2020 21:35:32 +0000 (23:35 +0200)] 
feat(corpus): make it possible to create new files from search

2 years agofix(vim): degrade nicely if Ferret is disabled
Greg Hurrell [Wed, 15 Apr 2020 00:55:59 +0000 (02:55 +0200)] 
fix(vim): degrade nicely if Ferret is disabled

2 years agofix(corpus): actually detect backticks
Greg Hurrell [Tue, 14 Apr 2020 17:05:37 +0000 (19:05 +0200)] 
fix(corpus): actually detect backticks

Given:

   foo `bar` baz

On finding first backtick, intent was to find second one, but we just
found the same one again due to our failure to add one to the index.
This broke code span detection, cause this to get improperly treated as
a shortcut link:

    foo `baz [bar] boom`

Same problem doesn't occur with links:

    foo [bar] baz

Because when we are at "[" and scan ahead looking for "]", there is no
possibility of finding "]" at "[" even without the index increment,
because they obviously don't match.

2 years agofix(corpus): fix bad fence detection pattern
Greg Hurrell [Tue, 14 Apr 2020 16:54:22 +0000 (18:54 +0200)] 
fix(corpus): fix bad fence detection pattern

Was preventing fenced code blocks from being detected.

2 years agofix(corpus): remove errant logging
Greg Hurrell [Tue, 14 Apr 2020 16:54:08 +0000 (18:54 +0200)] 
fix(corpus): remove errant logging

2 years agofix(corpus): stop indentLine from messing with corpus buffers
Greg Hurrell [Tue, 14 Apr 2020 16:48:33 +0000 (18:48 +0200)] 
fix(corpus): stop indentLine from messing with corpus buffers

"markdown.corpus" is what the filetype will be in practice, but we add
"corpus" too just for completeness.

2 years agochore(fig): clean up straggling deno reference
Greg Hurrell [Tue, 14 Apr 2020 00:46:12 +0000 (02:46 +0200)] 
chore(fig): clean up straggling deno reference

2 years agofix(corpus): abort link detection if you run into an adjacent link
Greg Hurrell [Tue, 14 Apr 2020 00:42:56 +0000 (02:42 +0200)] 
fix(corpus): abort link detection if you run into an adjacent link

Otherwise, if cursor is on "foo" in:

    This [is a link] and foo is before [another link].

Then we'll end up thinking that we found one big (and invalid) link:

         [is a link] and foo is before [another link]

instead of linking foo:

    This [is a link] and [foo] is before [another link].

2 years agorefactor(corpus): remove unnecessary "repo" config
Greg Hurrell [Mon, 13 Apr 2020 23:56:50 +0000 (01:56 +0200)] 
refactor(corpus): remove unnecessary "repo" config

2 years agorefactor(corpus): clean up a code comment
Greg Hurrell [Mon, 13 Apr 2020 21:57:27 +0000 (23:57 +0200)] 
refactor(corpus): clean up a code comment

2 years agofix(corpus): work around unexpected `git-grep -z` behavior
Greg Hurrell [Mon, 13 Apr 2020 19:15:33 +0000 (21:15 +0200)] 
fix(corpus): work around unexpected `git-grep -z` behavior

It does not behave like `git-ls-files -z`, which emits paths as-is.
Rather, it will omit paths like those noted in the comments.

2 years agofix(corpus): store labels case insensitively
Greg Hurrell [Mon, 13 Apr 2020 18:54:30 +0000 (20:54 +0200)] 
fix(corpus): store labels case insensitively

So as to avoid creating duplicate link reference definitions given input
like:

    [Open source] is more than just [open source].

    ie. we want:

    [Open source]: /wiki/Open_source

    not:

    [Open source]: /wiki/Open_source
    [open source]: /wiki/open_source

2 years agofix(vim): use alternate means of suppressing colorcolumn for dirvish
Greg Hurrell [Mon, 13 Apr 2020 16:46:40 +0000 (18:46 +0200)] 
fix(vim): use alternate means of suppressing colorcolumn for dirvish

2 years agostyle(corpus): fix code formatting
Greg Hurrell [Mon, 13 Apr 2020 16:41:44 +0000 (18:41 +0200)] 
style(corpus): fix code formatting

2 years agofix(corpus): make sure preview redraws
Greg Hurrell [Mon, 13 Apr 2020 16:26:25 +0000 (18:26 +0200)] 
fix(corpus): make sure preview redraws

2 years agoperf(corpus): make synthetic preview window
Greg Hurrell [Mon, 13 Apr 2020 16:02:51 +0000 (18:02 +0200)] 
perf(corpus): make synthetic preview window

Because it might be faster.

2 years agoperf(corpus): debounce previews
Greg Hurrell [Mon, 13 Apr 2020 15:49:57 +0000 (17:49 +0200)] 
perf(corpus): debounce previews

Because they are super slow.

2 years agorefactor(git): tweak a couple of aliases
Greg Hurrell [Mon, 13 Apr 2020 13:03:42 +0000 (15:03 +0200)] 
refactor(git): tweak a couple of aliases

To avoid mistakes like this one:

https://github.com/liferay/liferay-ckeditor/pull/56

In that repo, we have a submodule that is set up with an "ignore" value
of "all", which means that you don't see submodule changes in `git diff`
and you can't accidentally make changes with `git add`. At least, that's
the theory. You are supposed to use the provided "ck.sh" script in that
repo to do the updates, and that one uses `git add -f` under the cover
to do its work.

Turns out that `git add -u` also ends up adding submodule changes just
like `git add -f` would; "ouch", because it is super easy to do it by
accident and miss what you're doing because it isn't shown by `git
diff`.

We made a fix over there to catch mistakes in CI, but I can make a
change here that helps too: this commit makes `git staged` (and `git
both`, which is rarely used) show submodule commit changes, thus making
them harder to miss. Using "dirty" which will only show changes to the
commit that the submodule points at, which is what we care about in this
case (this is the only way to influence what is in a submodule checkout
from the contents of a commit).

2 years agochore(vim): switch from NERDTree to Dirvish
Greg Hurrell [Mon, 13 Apr 2020 13:01:54 +0000 (15:01 +0200)] 
chore(vim): switch from NERDTree to Dirvish

As much as I like having a tree view available to me, the slowness of
NERDTree is driving me up the wall. Hopefully, tree view will come to
Dirvish eventually:

https://github.com/justinmk/vim-dirvish/issues/70

2 years agorefactor(corpus): remove dead code
Greg Hurrell [Mon, 13 Apr 2020 00:29:59 +0000 (02:29 +0200)] 
refactor(corpus): remove dead code

2 years agofix(corpus): work around for ftdetect not running on first
Greg Hurrell [Mon, 13 Apr 2020 00:28:44 +0000 (02:28 +0200)] 
fix(corpus): work around for ftdetect not running on first

2 years agofeat(corpus): approach feature-completeness for initial version
Greg Hurrell [Sun, 12 Apr 2020 23:32:04 +0000 (01:32 +0200)] 
feat(corpus): approach feature-completeness for initial version

2 years agofeat(corpus): preview when switching via c-j, c-k
Greg Hurrell [Sun, 12 Apr 2020 19:26:41 +0000 (21:26 +0200)] 
feat(corpus): preview when switching via c-j, c-k

2 years agofeat(corpus): prototype of typeahead search
Greg Hurrell [Sun, 12 Apr 2020 19:17:45 +0000 (21:17 +0200)] 
feat(corpus): prototype of typeahead search

2 years agofix(corpus): make sure we actually get config when trying to jump
Greg Hurrell [Sun, 12 Apr 2020 16:50:29 +0000 (18:50 +0200)] 
fix(corpus): make sure we actually get config when trying to jump

2 years agochore(corpus): give up on fancy search/navigation for now
Greg Hurrell [Sun, 12 Apr 2020 16:33:22 +0000 (18:33 +0200)] 
chore(corpus): give up on fancy search/navigation for now

As noted in the comments, navigating via the quickfix listing is too
slow, any we don't want to pollute the stack with junk anyway.

Trouble is we have fast content search (eg. ":Ack") and fast title
search (eg. ":CommandT"), but we don't have a slick preview mechanism
like we do in the graphical Corpus.

We *might* be able to get something to work nicely with `:pedit` if we
hack deeply into Command-T, but I am not sure I want to do that.
Basically, it would consist of running a search powered by `git grep`
at the prompt (debounced), and basically just using Command-T's
MatchWindow, not its search, and plugging in `:pedit`-based preview
(likely debounced). At first blush, I don't think we want to do any of
that, and might be better off just reimplementing the MatchWindow
functionality from scratch using VimScript alone (and maybe some of the
newer functionality, like floating windows).

2 years agorefactor(corpus): lame attempt at making previewing faster
Greg Hurrell [Sun, 12 Apr 2020 16:22:37 +0000 (18:22 +0200)] 
refactor(corpus): lame attempt at making previewing faster

Doesn't work because the "current" quickfix item isn't changing.

2 years agorefactor(corpus): revisit preview windows etc
Greg Hurrell [Sun, 12 Apr 2020 15:32:17 +0000 (17:32 +0200)] 
refactor(corpus): revisit preview windows etc

This is some early POC code that I wrote a while back. Now that I have a
basic version of the auto-linking working, I think it's time to start
looking at the "navigation/search" side of the equation.

2 years agofix(corpus): fix bad deletebufline() call
Greg Hurrell [Sun, 12 Apr 2020 15:29:01 +0000 (17:29 +0200)] 
fix(corpus): fix bad deletebufline() call

"." will match any buffer with a name, so this was causing an E93 "more
than one match" as soon as you had more than one buffer.

2 years agofeat(corpus): support visual mode
Greg Hurrell [Sun, 12 Apr 2020 15:02:16 +0000 (17:02 +0200)] 
feat(corpus): support visual mode

2 years agofeat(corpus): make <C-]> navigate to a link target (or linkify)
Greg Hurrell [Sun, 12 Apr 2020 14:22:08 +0000 (16:22 +0200)] 
feat(corpus): make <C-]> navigate to a link target (or linkify)

2 years agofeat(corpus): partially sort link reference definitions
Greg Hurrell [Sun, 12 Apr 2020 12:23:01 +0000 (14:23 +0200)] 
feat(corpus): partially sort link reference definitions

We don't re-sort existing ones, but we at least make sure that any new
ones that we add get inserted in sorted order relative to each other.

2 years agofeat(corpus): implement crude target transform
Greg Hurrell [Sun, 12 Apr 2020 12:08:40 +0000 (14:08 +0200)] 
feat(corpus): implement crude target transform

To avoid unwanted "%20" in web URLs.

2 years agofeat(corpus): get autolinking working
Greg Hurrell [Sun, 12 Apr 2020 12:01:19 +0000 (14:01 +0200)] 
feat(corpus): get autolinking working

Still need transform though, for the Masochist use case. Because if we
link to a page like "[some page]", the link reference definition will
be:

    [some page]: </wiki/some page>

And the link works, but it takes you to:

    https://wincent.com/wiki/some%20page

instead of:

    https://wincent.com/wiki/some_page

2 years agotest(corpus): add some stub tests
Greg Hurrell [Fri, 10 Apr 2020 19:16:40 +0000 (21:16 +0200)] 
test(corpus): add some stub tests

2 years agofeat(corpus): don't manage titles automatically unless autotitle is set
Greg Hurrell [Fri, 10 Apr 2020 14:40:18 +0000 (16:40 +0200)] 
feat(corpus): don't manage titles automatically unless autotitle is set

2 years agorefactor(corpus): deduplicate some logic
Greg Hurrell [Fri, 10 Apr 2020 13:29:04 +0000 (15:29 +0200)] 
refactor(corpus): deduplicate some logic

2 years agofeat(corpus): update tags when auto-updating metadata
Greg Hurrell [Fri, 10 Apr 2020 13:24:24 +0000 (15:24 +0200)] 
feat(corpus): update tags when auto-updating metadata

2 years agofeat(corpus): update title metadata on save
Greg Hurrell [Fri, 10 Apr 2020 13:15:39 +0000 (15:15 +0200)] 
feat(corpus): update title metadata on save

2 years agofeat(corpus): add multi-directory configuration
Greg Hurrell [Fri, 10 Apr 2020 11:30:47 +0000 (13:30 +0200)] 
feat(corpus): add multi-directory configuration

Because ultimately I want to leverage this for both Corpus and
Masochist.

2 years agorefactor(corpus): start preparing minimal version of Corpus experiment
Greg Hurrell [Fri, 10 Apr 2020 00:04:41 +0000 (02:04 +0200)] 
refactor(corpus): start preparing minimal version of Corpus experiment

2 years agochore(corpus): enable Corpus experiment but turn it into a no-op
Greg Hurrell [Thu, 9 Apr 2020 22:35:33 +0000 (00:35 +0200)] 
chore(corpus): enable Corpus experiment but turn it into a no-op

Because I am still deciding on the approach to take. This is stuff I've
had locally in a plug-in for many months now thinking that I would like
to replace the Corpus Electron app with an in-Vim solution:

https://github.com/wincent/corpus

One of my major gripes that I'd like to tackle with this is that:

- Linking within Markdown kind of sucks; see:
  https://github.com/wincent/masochist/issues/145
- Corpus isn't Vim.

But Corpus has some features that I really like, like easy content and
title searching (with previewing, which is what I was trying to get at
with this experiment).

I think the way forward here might be as simple as setting up some
mappings to make it easy to create articles from links, and update
metadata fields and link footers, and jump to linked articles.

The problem noted in here of title and content searched not jiving well
together can be fixed by adding metadata to each doc and updating titles
on save.

2 years agofeat: use up/down to move among quickfix results
Greg Hurrell [Thu, 6 Jun 2019 22:14:24 +0000 (00:14 +0200)] 
feat: use up/down to move among quickfix results

Without leaving the command-line.

2 years agofeat: integrate quickfix list and proper search
Greg Hurrell [Thu, 6 Jun 2019 21:29:04 +0000 (23:29 +0200)] 
feat: integrate quickfix list and proper search

With this, things are almost usable, if you squint.

2 years agofeat: use Git to search inside files
Greg Hurrell [Tue, 4 Jun 2019 23:04:54 +0000 (01:04 +0200)] 
feat: use Git to search inside files

2 years agofeat: add initial experimentation with previews
Greg Hurrell [Tue, 4 Jun 2019 21:45:37 +0000 (23:45 +0200)] 
feat: add initial experimentation with previews

Just experimenting with UI patterns at this point. First tried the
approach shown here (custom command mode completion, showing preview
window for selected files) and couldn't get it to work. Then went down
rabbit hole with `getchar()` (also couldn't get it to work).

Discovered that in both case I just need a `:redraw` to force update the
display and show preview, but seeing the number of edge cases I'd need
to handle in the `getchar()` case I backed away a bit.

Issue with the approach as implemented in this commit is it is filename
based instead of content based (obviously), and it is incomplete (also
obviously); but still, I'm pleased that the preview stuff works as well
as it does. Shows promise even if I go back and explore a `getchar()`
type thing again.