From f32042f317c42e408fd62c9ce42b1d5c7ab3ba2a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 23 May 2022 01:04:36 +0100 Subject: Add README with example config stuff --- README | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 README (limited to 'README') diff --git a/README b/README new file mode 100644 index 0000000..aedbabd --- /dev/null +++ b/README @@ -0,0 +1,86 @@ +Want the same editor setup as me and don't want to jump through the admittedly +terribly annoying setup hoops that really shouldn't be necessary? + +Windows: + cd /D "%LocalAppData%\nvim" + md pack + cd pack + git clone https://git.mikes.software/nvim-mike mike + +Unix: + cd "~/.config/nvim" + mkdir pack + cd pack + git clone https://git.mikes.software/nvim-mike mike + +*Also make sure you have fzf on your path!* + +In your init.vim, try some of these options on for size: + +``` +set tgc +color monochrome +set ff=unix ffs=unix,dos +set sw=4 ts=4 noet tw=80 cc=80 +set spr sb +set pb=12 winbl=12 +set fcs=eob:\ list lcs=tab:\│\ ,trail:⎵ +" on windows, prevents hanging! on unix, get rid of this. +nmap +let g:mapleader = " " +set mouse=a + +function s:InitLSP() +lua <e", "lua vim.diagnostic.open_float()") + nn("[d", "lua vim.diagnostic.goto_prev()") + nn("]d", "lua vim.diagnostic.goto_next()") + + local function onattach(client, buf) + nn("gD", "lua vim.lsp.buf.declaration()") + nn("gd", "lua vim.lsp.buf.definition()") + nn("K", "lua vim.lsp.buf.hover()") + nn("gi", "lua vim.lsp.buf.implementation()") + nn("", "lua vim.lsp.buf.signature_help()") + nn("D", "lua vim.lsp.buf.type_definition()") + nn("r", "lua vim.lsp.buf.rename()") + nn("A", "lua vim.lsp.buf.code_action()") + nn("R", "lua vim.lsp.buf.references()") + nn("f", "lua vim.lsp.buf.formatting()") + end + local servers = {"clangd"} -- add others here if you use them! + for _, lsp in pairs(servers) do + lspconfig[lsp].setup { + capabilities = caps, + on_attach = onattach, + flags = {debounce_text_changes = 500} + } + end +EOF +endfunction + +au VimEnter * call s:InitLSP() +``` + +NOTE: the above more-or-less roughly reflects my settings at the time of +bothering to write this README. You may wish to change them, and I may have also +changed them since. 'Sjust an example! + +vi: sw=4 ts=4 noet tw=80 cc=80 -- cgit v1.2.3