all repos — dotfiles @ 7da7eccefb57d741a9a08dcd29e650b883d0069a

my *nix dotfiles

Nifty nvim configs for go
Anirudh Oppiliappan x@icyphox.sh
Sat, 05 Dec 2020 10:11:44 +0530
commit

7da7eccefb57d741a9a08dcd29e650b883d0069a

parent

b8eff9c20cd1f5a4c47d15f8435a20a8ec9d02af

4 files changed, 57 insertions(+), 5 deletions(-)

jump to
M config/nvim/ftplugin/go.vimconfig/nvim/ftplugin/go.vim

@@ -2,3 +2,49 @@ setlocal noexpandtab

setlocal autoindent setlocal smarttab setlocal formatoptions=croql + +" stolen from https://go.googlesource.com/go/+/c4f5421/misc/vim/ftplugin/go/fmt.vim + +if exists("b:did_ftplugin_go_fmt") + finish +endif +if !exists("g:go_fmt_commands") + let g:go_fmt_commands = 1 +endif +if !exists("g:gofmt_command") + if executable("goimports") + let g:gofmt_command = "goimports" + else + let g:gofmt_command = "gofmt" + endif +endif +if g:go_fmt_commands + command! -buffer Fmt call s:GoFormat() +endif +function! s:GoFormat() + let view = winsaveview() + silent execute "%!" . g:gofmt_command + if v:shell_error + let errors = [] + for line in getline(1, line('$')) + let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)') + if !empty(tokens) + call add(errors, {"filename": @%, + \"lnum": tokens[2], + \"col": tokens[3], + \"text": tokens[4]}) + endif + endfor + if empty(errors) + % | " Couldn't detect gofmt error format, output errors + endif + undo + if !empty(errors) + call setloclist(0, errors, 'r') + endif + echohl Error | echomsg "Gofmt returned error" | echohl None + endif + call winrestview(view) +endfunction +let b:did_ftplugin_go_fmt = 1 +" vim:ts=4:sw=4:et
A config/nvim/plugin/go.vim

@@ -0,0 +1,1 @@

+autocmd BufWritePre *.go Fmt
M home/.Xresourceshome/.Xresources

@@ -6,7 +6,7 @@ ! _ / |/ / / __(__ ) /_/ / /_/ / / / /__/ __(__ )

!(_)_/|_/_/ \___/____/\____/\__,_/_/ \___/\___/____/ ! -#include ".colors/dark" +#include ".colors/light" *.font: SF Mono:style=Regular:size=12:antialias=true
M weechat/weechat.confweechat/weechat.conf

@@ -390,10 +390,15 @@ title.type = window

[layout] default.buffer = "core;weechat;1" -default.buffer = "irc;server.deavmi;2" -default.buffer = "irc;deavmi.#crxn;3" -default.buffer = "irc;deavmi.#general;4" -default.buffer = "irc;deavmi.#programming;5" +default.buffer = "fset;fset;2" +default.buffer = "irc;server.rizon;3" +default.buffer = "irc;rizon.#/g/punk;4" +default.buffer = "irc;rizon.#buddy;5" +default.buffer = "irc;rizon.#crimson;6" +default.buffer = "irc;rizon.#homescreen;7" +default.buffer = "irc;rizon.#rice;8" +default.buffer = "irc;rizon.*status;9" +default.buffer = "irc;rizon.owolvie;10" default.window = "1;0;0;0;irc;rizon.Carp" default.current = on