From 31de117293d9459ca6114ef95e2cab571381e58b Mon Sep 17 00:00:00 2001 From: CrawDad1 Date: Sat, 25 Feb 2023 01:32:57 -0600 Subject: [PATCH] first solid config. Can still be improved --- README.md | 6 +++++- ftplugin/fsharp.lua | 4 ++++ init.lua | 44 ++++++++++++++++++++++++++++++++++++-------- myChanges.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ myWinDeps.md | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+), 9 deletions(-) create mode 100644 ftplugin/fsharp.lua create mode 100644 myChanges.md create mode 100644 myWinDeps.md diff --git a/README.md b/README.md index 75c24d84..be1595ba 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# kickstart.nvim +# kickstart.nvim - CrawDad Fork + +still working on some lsp issues on local machine + +Check 'myChanges.md' and 'myWinDeps.md' for changes and required dependencies for my changes. ### Introduction diff --git a/ftplugin/fsharp.lua b/ftplugin/fsharp.lua new file mode 100644 index 00000000..a20f096f --- /dev/null +++ b/ftplugin/fsharp.lua @@ -0,0 +1,4 @@ + +-- previous binding +-- runs selected code in FSI, exit fsi with "i" after done scrolling/viewing +vim.keymap.set('v', '', 'y:new:termidotnet fsi pGA;;#quit;;exitG') \ No newline at end of file diff --git a/init.lua b/init.lua index fe36fbed..c21580d5 100644 --- a/init.lua +++ b/init.lua @@ -90,6 +90,7 @@ require('lazy').setup({ -- Automatically install LSPs to stdpath for neovim 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', + 'RishabhRD/nvim-lsputils', -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` @@ -107,6 +108,8 @@ require('lazy').setup({ -- Useful plugin to show you pending keybinds. { 'folke/which-key.nvim', opts = {} }, + { 'folke/trouble.nvim', opts = {} }, + 'nvim-tree/nvim-web-devicons', { -- Adds git releated signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { @@ -204,6 +207,8 @@ require('lazy').setup({ -- [[ Setting options ]] -- See `:help vim.o` +-- uses spaces for indentation +vim.o.inde = " " -- Set highlight on search vim.o.hlsearch = false @@ -249,6 +254,10 @@ vim.o.termguicolors = true -- normal mode -- **filepath stuff** vim.keymap.set('n', 'gf', ':vert winc f') + +-- this line does 2 things at once! +-- copies curent path to register: f, path + file to register: F +vim.keymap.set('n', 'yf', ':let @f = expand("%:p") |:let @F = expand("%:p:h")') -- moves split panes vim.keymap.set('n', '', 'H') vim.keymap.set('n', '', 'J') @@ -259,6 +268,9 @@ vim.keymap.set('n', '', 'h') vim.keymap.set('n', '', 'j') vim.keymap.set('n', '', 'k') vim.keymap.set('n', '', 'l') +-- insert line break left of cursor +vim.keymap.set('n', 'K', 'i^') + -- insert mode -- these 2 shift current line in insert mode vim.keymap.set('i', '', ':m .+1==gi') @@ -267,6 +279,11 @@ vim.keymap.set('i', '', ':m .-2==gi') -- these 2 exit insert mode easily vim.keymap.set('i', 'JJ', '') vim.keymap.set('i', 'jk', '') +-- remove comment on line +vim.keymap.set('i', '', 'gcc') +-- Terminal mode +-- easier normal mode +vim.keymap.set('t', 'JJ', "") -- Keymaps for better default experience -- See `:help vim.keymap.set()` @@ -327,7 +344,7 @@ require('nvim-treesitter.configs').setup { ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'help', 'vim' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, + auto_install = true, highlight = { enable = true }, indent = { enable = true, disable = { 'python' } }, @@ -420,8 +437,8 @@ local on_attach = function(_, bufnr) nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') -- See `:help K` for why this keymap - nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') + nmap('gh', vim.lsp.buf.hover, 'Hover Documentation') + nmap('gH', vim.lsp.buf.signature_help, 'Signature Documentation') -- Lesser used LSP functionality nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') @@ -443,11 +460,12 @@ end -- Add any additional override configuration in the following tables. They will be passed to -- the `settings` field of the server config. You must look up that documentation yourself. local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- tsserver = {}, + clangd = {}, + pyright = {}, + rust_analyzer = {}, + tsserver = {}, + fsautocomplete = {}, + jdtls = {}, lua_ls = { Lua = { @@ -529,5 +547,15 @@ cmp.setup { }, } +--GUI settings +--NeoVide +if vim.g.neovide then + --do stuff for neovide Only + vim.g.neovide_cursor_animation_length = 0.35 + vim.g.neovide_cursor_trail_size = 0.2 + vim.g.neovide_cursor_vfx_mode = 'railgun' + vim.g.neovide_cursor_vfx_particle_lifetime = 1.2 + vim.opt.guifont = { "Hack NF", "h16" } +end -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/myChanges.md b/myChanges.md new file mode 100644 index 00000000..306b6fff --- /dev/null +++ b/myChanges.md @@ -0,0 +1,45 @@ +# Changes made to base nvim-Kickstart +## working LSP +### ez +- python +### needs project file +- c++ (kind of picky, single file mode doesn't work well) +- F# (kind of picky, single file mode doesn't work well) +- rust 🦀 (.rsx files seem to work in single file mode) + +## Settings +### nvim general settings +- set indents as 4 'space' characters +### nvim gui settings +- neovide gui + - added cursor trail config + - set font to NerdFonts / Hack h16 +### Language server settings +- added server inits for: + - clangd + - pyright + - rust_analyzer + - tsserver + - fsautocomplete + - jdtls +## Plugins +- 'RishabhRD/nvim-lsputils' added for better lsp default settings +- 'folke/trouble.nvim' to view error messages at bottom + - 'nvim-tree/nvim-web-devicons' for icon support in trouble +### Misc +- set 'treesitter :: auto_install = true. should auto install grammars +- telescope fzf converted to use windows ripgrep + +## Mappings +### Normal Mode +- 'yf' copies path to current file to register f and F +- 'K' inserts a line break left of cursor and places cursor on first non white-space character +- 'gh' for lsp hover docs +- 'gH' for lsp signature docs +### Insert Mode +- 'JJ' easily exits insert mode (even in terminal mode) +## FileType Scripts +### F# +- visual mode (selection) + - added binding to run selected code in FSI, similar to visual studio + \ No newline at end of file diff --git a/myWinDeps.md b/myWinDeps.md new file mode 100644 index 00000000..64b3f96a --- /dev/null +++ b/myWinDeps.md @@ -0,0 +1,39 @@ +# My Windows Dependencies + +# Packages +I believe thse are the install commands used, many sub-packages also installed automatically + +- neovim +- neovide.install +- lua +- nodejs.install +- ripgrep +- rust +- rustup.install +- FiraCode +- nerd-fonts-Hack + +# Complete List + +May have missed some dependencies, but this is a complete list of 'chocolatey' package manager installations used to make LSP work properly. + +FiraCode 6.2 +KB2919355 1.0.20160915 +KB2919442 1.0.20160915 +KB2999226 1.0.20181019 +KB3033929 1.0.5 +KB3035131 1.0.3 +lua 5.1.5.52 +neovide 0.10.3 +neovide.install 0.10.3 +neovim 0.8.3 +nerd-fonts-Hack 2.3.3 +nodejs 19.6.0 +nodejs.install 19.6.0 +ripgrep 13.0.0.20220913 +rust 1.67.1 +rustup.install 1.25.1 +vcredist140 14.34.31938 +vcredist2005 8.0.50727.619501 +vcredist2015 14.0.24215.20170201 +vim 9.0.1221 \ No newline at end of file