Commit graph

67 commits

Author SHA1 Message Date
Jonathan Hodgson
8ea14abe9e Adds treesitter and biscuit plugins + tweak to sudo write
The two plugins were added along with relevant configuration for each

If in neovim and sudo_askpass isn't set, vim will display a warning if
WW is typed in command mode
2021-11-17 14:41:49 +00:00
Jonathan Hodgson
7cb88eb204 Updates vim plugins 2021-11-16 16:03:03 +00:00
Jonathan Hodgson
c7721e7468 Updates lsp config 2021-11-16 15:57:13 +00:00
Jonathan Hodgson
c9d1320b54 Adds sudo writes to nvim
If in nvim and the SUDO_ASKPASS environment variable is set then a WW
mapping will expand to

:w !sudo -A tee % >/dev/null

If in not-neo vim, the -A is omitted.

The environment variable is also set. Some unused environment variables
were also removed.

https://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work
https://github.com/neovim/neovim/issues/12103
2021-11-16 14:29:20 +00:00
Jonathan Hodgson
9816fbb258 VIM: Adds functions for proselint and languagetool 2021-10-07 22:13:50 +01:00
Jonathan Hodgson
5f35102a96 VIM: Fixes lsp config 2021-09-07 17:00:35 +01:00
Jonathan Hodgson
9255032a61 VIM: Closes preview window after completion 2021-09-07 16:59:55 +01:00
Jonathan Hodgson
c5571a6de4 Sets default fold method to indent 2021-09-07 16:59:24 +01:00
Jonathan Hodgson
8cb2d607e6 Updates vim plugins 2021-09-07 16:58:09 +01:00
Jonathan Hodgson
2839b8e2bc VIM: Setup ripgrep and inccommand
RIPGREP

ripgrep is now my grep command and I can use [c and ]c for moving
between quickfix entries

INCCOMMAND

Setting this makes vim show the results of substitute commands as they
are types
2021-07-30 10:50:27 +01:00
Jonathan Hodgson
56174f1ddc VIM: reselect visual selection after encodeing change
This change makes vim re-select the portion of text that was changed
after an encoding change.
2021-05-10 09:19:37 +01:00
Jonathan Hodgson
5ed6dc194c Adds Lexima and ultisnips
Lexima auto-closes brackets and quotes etc.
2021-04-06 12:44:28 +01:00
Jonathan Hodgson
9b4c064acd VIM: Keep selection when using < or > in visual mode
When indenting or unindenting a code block, I normally visually select
it and use < or >. However, both of these unselect the selection.

The mappings make vim also do gv after such an action which re-selects
the previous selection.
2021-01-19 16:20:10 +00:00
Jonathan Hodgson
92de12d1a8 VIM: adds firevim config
Does 2 thing:
* sets up my setting for editing text (spell checking etc)
* Sets the content type to html for domains starting with mail.
2020-12-21 16:16:37 +00:00
Jonathan Hodgson
34b1b0be20 VIM: make filename in statusline 30 chars (maximum) 2020-12-21 16:15:30 +00:00
Jonathan Hodgson
a4a520aa02 VIM: Hides git branch "blob" on status line if not in a git project 2020-12-14 11:27:14 +00:00
Jonathan Hodgson
741dc650df VIM: Adds lsp bindings for more languages 2020-12-13 20:58:19 +00:00
Jonathan Hodgson
f1c2c3fcb2 VIM: Significant style changes to statusline
I have used colour and powerline symbols to differentiate different
parts of my status line.

Inspiration came from this:
https://www.reddit.com/r/vimporn/comments/kbtu74/my_theme_called_humanoid_and_my_statusbar/
2020-12-13 20:55:06 +00:00
Jonathan Hodgson
26a70aef93 VIM: Adds firevim plugin 2020-12-07 11:36:54 +00:00
Jonathan Hodgson
62230ac526 VIM: Adds ansiescape submodule
This plugin allows you to apply ansi colour escapes in a vim buffer
2020-11-02 17:08:22 +00:00
Jonathan Hodgson
376a1aeb66 VIM: Updates plugins 2020-10-29 09:47:20 +00:00
Jonathan Hodgson
7c762ec1ba VIM: Updates plugins 2020-10-27 15:55:17 +00:00
Jonathan Hodgson
068bc6e3c1 VIM: Sets ignore case and smart case
This means vim will search case insensitively until a capital letter is
inserted
2020-10-24 13:54:34 +01:00
Jonathan Hodgson
22adb0a397 VIM: Makes markdown files 80 chars width 2020-10-24 13:54:06 +01:00
Jonathan Hodgson
a02e8ff6f0 VIM: Adds language servers
Addes for vue, python and c
2020-10-24 13:52:42 +01:00
Jonathan Hodgson
a781e5d67a VIM: Adds request syntax file
File was simply taken from my old Vim configuration.

It inherits most of the html syntax as it is set on responses as well as
requests

Also, adds some request / response specific highlighting for things like
http method etc.
2020-10-13 10:44:28 +01:00
Jonathan Hodgson
c050efe3b5 VIM: Adds bindings to default to "very magic" searching
By default, vim's reg-ex matching is weird. For example:

> * is special when not escaped but…
> + is special when escaped
> \{x,y} (escaping only the opening bracket) works but…
> You have to use \( \) (escape both parens)
> [] is special when both are unescaped

Source: https://wincent.com/wiki/Vim_regexes

For more details, check out Greg Hurrell's screencast:
https://www.youtube.com/watch?v=VjOcINs6QWs
2020-10-10 18:06:49 +01:00
Jonathan Hodgson
9ba7608e66 VIM: colour column on textwidth or if not set col 80
This had to be done in a FileType * autocmd so that it is done once file
type has been determined and textwidth is set, as suggested by tae on
discord

7630218973
2020-10-06 14:28:50 +01:00
Jonathan Hodgson
9479b9574e VIM: adds compile shortcuts and open shortcuts 2020-10-06 14:27:37 +01:00
Jonathan Hodgson
4d960bfe43 VIM: Makes fzf open in a floating window rather than as a split 2020-10-06 13:21:15 +01:00
Jonathan Hodgson
1096526ef3 VIM: Adds bash language server support 2020-10-06 13:20:48 +01:00
Jonathan Hodgson
d8408ebb00 VIM: Makes status line show cursor column 2020-10-06 13:20:17 +01:00
Jonathan Hodgson
341d45e4f3 VIM: Makes vim auto-add comment character
It will do this in insert mode when pushing <enter> or when in normal
mode when pushing o or O
2020-10-06 13:14:56 +01:00
Jonathan Hodgson
9b62d793ae VIM: Fixes <del> key
For some reason the del key isn't working for me so I re-map it
<right><bs>
2020-09-29 14:26:19 +01:00
Jonathan Hodgson
8a05cf8689 VIM: Moves lsp config into after folder
This forces it to initialise everything after my colourscheme etc have
been set resulting in error messages being read.
2020-09-29 14:25:04 +01:00
Jonathan Hodgson
3c19dd0ace VIM: Makes vim open external files with opout
Vim can open external files when the cursor is "over" them by pushing gx

If in a netrw window, simply x is used.

This is useful when in, for example, a markdown file. I can view the
image by putting the cursor over the path and pushing gx
2020-09-29 08:50:23 +01:00
Jonathan Hodgson
9058178187 VIM: Sets up simple statusbar 2020-09-28 14:36:19 +01:00
Jonathan Hodgson
a315410608 VIM: Adds vim fugitive plugin 2020-09-28 14:31:01 +01:00
Jonathan Hodgson
ed19fc413b VIM: Stops vim wrapping mid word 2020-09-28 11:37:52 +01:00
Jonathan Hodgson
be84812aaa VIM: adds hex encoding and decoding 2020-09-27 01:10:22 +01:00
Jonathan Hodgson
c94fb3a761 VIM: Adds mappings for url and base64 encoding / decoding
Defines functions for each as autoload functions. I need to look into
weather it would be better to have this as a local function in a plugin.

The function for url encoding was taken from vim-unimpared:
https://github.com/tpope/vim-unimpaired
I don't need all the functionality it provides

The function for base64 encoding was taken from vim-base64:
https://github.com/christianrondeau/vim-base64
although I use it with mappings in the vim-unimpared style

[b and ]b base64 encode and decode respectively
[u url encodes characters that are normally encodede in a url
[U url encodes all characters
]u and ]U both urldecode all encodede characters
2020-09-27 01:10:17 +01:00
Jonathan Hodgson
33777548d5 VIM: Adds autoload function for writing mode
Writing mode is to be used when I am writing prose rather than code, for
example markdown files or emails.

Currently, it enables spellcheck and adds insert mode mappings that add
undo points when certain punctuation is inserted, such as full stops or
commas.

Currently this is used for markdown files, emails and git commits
2020-09-26 23:09:51 +01:00
Jonathan Hodgson
ec1e8d41f9 VIM: Sets spell on mail and md files 2020-09-26 22:46:54 +01:00
Jonathan Hodgson
3a3a547206 VIM: Adds mapping for shebang line
The shebang line is used to determine which should interpreter should be
used when executing the file

The mapping here adds the string `#!/usr/bin/env ` at the begining of
the line.

https://en.wikipedia.org/wiki/Shebang_(Unix)
2020-09-26 22:35:00 +01:00
Jonathan Hodgson
305b838c34 VIM: configures lsp for vim and go 2020-09-26 18:35:47 +01:00
Jonathan Hodgson
f8c81f35a0 VIM: adds lsp plugin for deoplete 2020-09-26 18:32:38 +01:00
Jonathan Hodgson
bb64b9df85 VIM: adds notmuch plugin for deoplete 2020-09-26 18:21:49 +01:00
Jonathan Hodgson
fa68f86507 VIM: adds abook plugin for deoplete 2020-09-26 18:13:28 +01:00
Jonathan Hodgson
e477f57e64 VIM: Makes deoplete start by default 2020-09-26 18:12:02 +01:00
Jonathan Hodgson
e0bbd0aade VIM: Adds deoplete plugin
This and LSP were the two things that made me make the switch to neovim.

It is a fast and configurable auto-complete tool
2020-09-26 17:59:41 +01:00