35 Commits

Author SHA1 Message Date
3a2337cd63 Add do#show_documentation() using coc.nvim
Change the `K` normal mode overrides to use the example given in the
coc.nvim README file which uses Vim's builtin help when in `vim` or
`help` files, or checks if coc.nvim is ready and invokes
`CocActionAsync('doHover')`, otherwise fallback to using `keywordprg`.
2021-04-18 14:42:33 +01:00
9a1b1ed2fc Replace vim-airline with a custom statusline
Finally got round to making a custom statusline after being inspired by
https://pastebin.com/Fm1NEgBf
2021-04-18 14:42:33 +01:00
eb1a4a71d8 Check if .vim directory exists before use
Update `build#dir()` to check for the existence of the `.vim` directory
containing `coc_settings.json` before attempting to read the file. If it
doesn't exist then create it.
2021-04-18 14:42:33 +01:00
bf6deaf1ed Configure cmake-language-server and coc-cmake
Utilises the following Python package:

```console
$ pip3 install --user cmake-language-server
```
2021-04-18 14:42:33 +01:00
8a2ca8c53f Update build#dir() to configure coc-clangd 2021-04-18 14:42:33 +01:00
92a23103e3 Fix vim-tmux-focus-events errors in command-line
When changing focus away and back to vim while in the middle of editing
the command-line, vim-tmux-focus-events emits errors from the function
called by the `:cnoremap` mappings. This patch replaces these mappings
with a call to `do#sink()` which does nothing. Simply removing the
mappings will result in `<F24><F25>` being inserted on the command-line
since tmux will send this text when `tmux set-option -g focus-events
on`, this is why `do#sink()` is needed.
2021-01-27 19:23:13 +00:00
9c64158445 Replace vim-gitgutter with vim-signify
vim-gitgutter is buggy. vim-signify might be better, it does allow
configuration of which events trigger a sign column update and this
patch takes advantage of that. Firstly, the `CursorHold` and
`CursorHoldI` events are disabled and replaced with `InsertLeave` and
`TextChanged` events. This makes the sign column updates immediate, and
since vim-signify is asynchronous it's faster too.
2021-01-26 23:45:49 +00:00
aaa8acf5a2 Update build#dir() to open a popup_menu()
Use `popup_menu()` in `build#dir()` when the `:BuildDir` command is uses
without an argument to specify a build directory. If there are no build
directories, print an error message. If there is a single build
directory, use it. If there are multiple build directories use
`popup_menu()` to prompt the user to select the desired build directory.

Update `build#targets()` and `build#run()` with comments and error
messages.
2021-01-06 00:23:32 +00:00
c94bc3ba90 Add autoloaded echomsg utility functions
* `echo#warning({message})` sets `echohl WarningMsg` and echos the message
* `echo#error({message})` sets `echohl ErrorMsg` and echos the message
2021-01-06 00:23:19 +00:00
a0df92852a Add :Build command to invoke ninja or make
The `:Build [<target> ...]` command utilises the `$BUILD_DIR` variable set
by `:BuildDir {directory}` to invoke `ninja` or `make` based on the
existence of `$BUILD_DIR/build.ninja` or `$BUILD_DIR/Makefile`
respectively. The following commands are invoked in a new `:terminal`
window.

* `ninja -C $BUILD_DIR [<target> ...]` when `$BUILD_DIR/build.ninja` exists
* `make -C $BUILD_DIR [<target> ...]` when `$BUILD_DIR/Makefile` exists

In the case of `ninja`, completion for the targets supplied to the
`:Build` command is made available by the `build#targets()` function.
The list of targets returned by `ninja -C $BUILD_DIR -t targets` is
processed to generate the list of targets. Support for `make` target
completion is less straight forwards so has been omitted for now.
2021-01-05 21:45:43 +00:00
0cd93f1823 Generalise tmux option check 2020-12-31 18:22:37 +00:00
c17f7ea0d9 Refactor tmux and set-clipboard detection
Move logic to `autoload/tmux.vim` to detect the `vim` is being run
inside a `tmux` sessions and if the `set-clipboard` option is enabled.
This cleans up adding the optional `oscyank.vim` plugin when needed.
2020-12-10 18:07:24 +00:00
d960053dfc Add :BuildDir to select YouCompleteMe build directory 2020-10-06 17:12:06 +01:00
7af8660355 Also set tmux navigation flag on FocusGained
Make using the `@vim$TMUX_PANE` window flag much more robust by
unsetting it every time the zsh prompt is drawn and setting it again
using a `FocusGained` `autocmd` in vim. This removes the need for the
hacky check for zsh in the conditional defined in the `in_vim` variable.
2019-08-16 21:58:38 +01:00
72fe59ffaa Only invoke last change substitution in help files
Previously the `autocmd` to replace the date on the first line if `Last
change: ` was present resulted in the cursor being moved in non `help`
filetypes due to the substitution failing. Now the substitution is only
attempted if the current file is a `help` file.
2019-04-04 16:53:46 +01:00
01b027b5ac Support snippet templates and add help snippets
Add `autocmd` to automatically expand the `_template` snippet on the
`BufNewFile` event, if the expansion fails because the `_template`
snippet does not exist for the current `filetype` undo the changes. Do
the same thing when the `filetype` changes to `help`, since these are
`text` files to begin with the first `autocmd` has no effect.
2019-03-31 15:04:08 +01:00
51621e8134 Remove vim-plug and use minpac
* Add `Pack`, `PackUpdate`, `PackStatus` and `PackClean` commands to
  manage plugins.
* Don't load `minpac` by default.
* Remove `vim-plug` completely.
2018-11-30 19:41:21 +00:00
c326a04f70 Don't use normal mode mappings in vimscript 2018-09-14 16:37:14 +01:00
992096a2a0 Add :Debug command
The :Debug command quickly starts a new debugging sessions.

* adds the `termdebug` package
* invokes `TermdebugCommand` with the given arguments
2018-09-14 16:17:09 +01:00
c80ddd3617 Add mapping to rename include guards in c/cpp 2018-09-07 22:13:29 +01:00
f7d07f23da Add TODO's for :LStripLines 2018-08-26 10:51:11 +01:00
1db9ea30ee Enable cursor shape changes by default 2018-08-26 10:50:08 +01:00
4c2d9b8089 Add do#cursor_escape_sequences()
Control the cursor shape based on the current mode.
2018-08-26 10:50:08 +01:00
4040dc7508 Move rarely used functions to autoload 2018-08-26 10:50:08 +01:00
e049445284 Remove autocmd to right string white space 2018-08-26 10:50:08 +01:00
981cb46c7c Add :ISort vim command 2018-08-26 10:50:08 +01:00
be47e8ec7b Update vim-plug 2018-08-26 10:50:07 +01:00
927889ce74 Remove macro_mode functions, use vim-replace 2018-08-26 10:49:14 +01:00
ce1d85c7b4 Add macro mode helpers
* Easily {un}map <CR> to @@
* Add macro_mode#{en,dis}able autoload functions
* Add MacroMode{En,Dis}able commands
2018-08-26 10:42:41 +01:00
5b27fcdbb1 Move .vimrc to .vim/vimrc split platform detection 2018-08-26 10:40:44 +01:00
4cf7ce0d32 Update vim-plug 2018-08-26 10:40:44 +01:00
e7b011c367 Final tweak vim-airline theme 2018-08-26 10:40:44 +01:00
1a43d6e810 Tweak colors for vim-airline fresh theme 2018-08-26 10:40:44 +01:00
e3ba637473 Add fresh vim-airline theme 2018-08-26 10:40:44 +01:00
3b1d816705 Add vim-plug script & update .vimrc 2018-08-26 10:36:10 +01:00