mirror of
https://github.com/jessebot/dot_files.git
synced 2025-10-01 01:48:43 +00:00
Major Neovim Update: Adding LSP config, indent, folding, remove minimap for scrollbar
This commit is contained in:
parent
38955b5458
commit
23e4169443
9 changed files with 212 additions and 49 deletions
|
@ -16,7 +16,7 @@ vim.opt.mousescroll = 'ver:0,hor:0'
|
|||
vim.opt.number = true
|
||||
vim.opt.numberwidth = 4
|
||||
|
||||
-- highlight current line - very useful, shouldn't turn off, you will be lost
|
||||
-- highlight current line
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- highlighted column 80, only on python files, to keep lines shorter
|
||||
|
@ -28,34 +28,54 @@ vim.opt.termguicolors = true
|
|||
-- make searching case insensitive
|
||||
vim.opt.ignorecase = true
|
||||
|
||||
-- indentation
|
||||
require('user.indent')
|
||||
|
||||
-- both of these are required to make packer, our plugin manager, work
|
||||
require('plugins')
|
||||
vim.cmd.source("~/.config/nvim/packerinit.vim")
|
||||
|
||||
-- --------- Plugin configs that have to be called after packer --------------
|
||||
-- Colors need to be enabled after the plugins, because the colors are a plugin
|
||||
vim.cmd.colorscheme('spacechalk')
|
||||
vim.g.colors_name = 'spacechalk'
|
||||
|
||||
-- tab completion for coc - conquer of completion
|
||||
vim.cmd.source("~/.config/nvim/vim/coc-nvim.vim")
|
||||
|
||||
-- --- these are plugin configs for plugins imported by packer ---
|
||||
require('user.fterm')
|
||||
-- require('mini.map').setup()
|
||||
require('user.nvim-colorizer')
|
||||
require('user.nvim-tree')
|
||||
require('user.tree-sitter')
|
||||
require('user.ale')
|
||||
require("scrollbar").setup({
|
||||
set_highlights = false,
|
||||
handlers = {
|
||||
cursor = true,
|
||||
diagnostic = true,
|
||||
handle = true,
|
||||
-- search = false, -- Requires hlslens
|
||||
ale = true,
|
||||
},
|
||||
})
|
||||
require('user.airline')
|
||||
-- starting page for neovim
|
||||
require('user.dashboard')
|
||||
|
||||
-- Language Server configs and other syntax checking and highlight tools
|
||||
require('user.lsp-configs')
|
||||
require('user.tree-sitter')
|
||||
|
||||
-- tab completion for coc - conquer of completion; might not need this after lsp-configs...
|
||||
-- vim.cmd.source("~/.config/nvim/vim/coc-nvim.vim")
|
||||
|
||||
-- folding
|
||||
require('user.folding')
|
||||
|
||||
-- linter/fixer
|
||||
require('user.ale')
|
||||
|
||||
-- syntax highlgihting for hex codes
|
||||
require('user.nvim-colorizer')
|
||||
|
||||
-- status line for vim; may change to galazyline or lualine; need to latest airline features
|
||||
require('user.airline')
|
||||
|
||||
-- directory tree for neovim; can option with :NvimTreeToggle
|
||||
require('user.nvim-tree')
|
||||
|
||||
-- scrollbar on the right side of the screen that also shows errors
|
||||
require("scrollbar").setup({
|
||||
set_highlights = false,
|
||||
handlers = {
|
||||
cursor = true,
|
||||
diagnostic = true,
|
||||
handle = true,
|
||||
-- search = false, -- Requires hlslens
|
||||
ale = true,
|
||||
},
|
||||
})
|
||||
|
||||
-- floating windows
|
||||
require('user.fterm')
|
||||
|
|
|
@ -57,6 +57,19 @@ return require('packer').startup(function(use)
|
|||
-- ---------------- scroll bar for the right hand side -------------------
|
||||
use {"petertriho/nvim-scrollbar"}
|
||||
|
||||
-- code location at top of window
|
||||
use({
|
||||
"utilyre/barbecue.nvim",
|
||||
tag = "*",
|
||||
requires = {
|
||||
"SmiteshP/nvim-navic",
|
||||
},
|
||||
after = "nvim-web-devicons", -- keep this if you're using NvChad
|
||||
config = function()
|
||||
require("barbecue").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- ------------------------------ git ------------------------------------
|
||||
-- git plugin for running git commands with :git -- 'tpope/vim-fugitive'
|
||||
use {'tpope/vim-fugitive'}
|
||||
|
@ -77,21 +90,28 @@ return require('packer').startup(function(use)
|
|||
-- This is helpful for markdown -- 'junegunn/limelight.config/vim'
|
||||
use {'junegunn/limelight.vim'}
|
||||
|
||||
-- ------------------------- general linter ------------------------------
|
||||
-- will use common linters and highlight broken code
|
||||
use {'dense-analysis/ale'}
|
||||
-- ---------------- Language Server Protocol Plugins ---------------------
|
||||
|
||||
-- --------------------- completion and searching ------------------------
|
||||
-- this helps to configure the built-in language server protocol for nvim
|
||||
use {'neovim/nvim-lspconfig'}
|
||||
use {'williamboman/mason.nvim'}
|
||||
use {'williamboman/mason-lspconfig.nvim'}
|
||||
|
||||
-- code completion
|
||||
-- use {'neoclide/coc.nvim', branch = 'release'}
|
||||
|
||||
-- ------------------- fuzzy completion for files ------------------------
|
||||
-- telescope: extendable fuzzy finder over lists
|
||||
use {'nvim-telescope/telescope.nvim', tag = '0.1.0',
|
||||
requires = {{'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
-- this is a modern fuzzy searcher; not sure if it's really useful in neovim
|
||||
-- modern fuzzy searcher; not sure if it's really useful in neovim 🤷
|
||||
use {'liuchengxu/vim-clap'}
|
||||
|
||||
-- code completion
|
||||
use {'neoclide/coc.nvim', branch = 'release'}
|
||||
-- ------------------------- general linter ------------------------------
|
||||
-- will use common linters and highlight broken code
|
||||
use {'dense-analysis/ale'}
|
||||
|
||||
-- --------------------- Language Specific Stuff -------------------------
|
||||
|
||||
|
@ -105,11 +125,11 @@ return require('packer').startup(function(use)
|
|||
use {'mtdl9/vim-log-highlighting'}
|
||||
|
||||
-- lua folding
|
||||
use{'anuvyklack/pretty-fold.nvim',
|
||||
config = function()
|
||||
require('pretty-fold').setup()
|
||||
end
|
||||
}
|
||||
-- use{'anuvyklack/pretty-fold.nvim',
|
||||
-- config = function()
|
||||
-- require('pretty-fold').setup()
|
||||
-- end
|
||||
-- }
|
||||
|
||||
-- terraform commands for neovim :)
|
||||
use {'hashivim/vim-terraform'}
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
-- FOLDING ZONE:
|
||||
-- collapse an entire block or function
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Enable folding on base indent
|
||||
vim.opt.foldmethod = 'indent'
|
||||
vim.opt.foldlevel = 99
|
||||
|
||||
-- also allow me to see the doc strings
|
||||
vim.g.SimpylFold_docstring_preview=1
|
||||
-- vim.g.SimpylFold_docstring_preview=1
|
||||
-- enable folding for markdown?
|
||||
vim.g.markdown_folding = 1
|
||||
-- vim.g.markdown_folding = 1
|
||||
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldlevelstart = 99
|
||||
|
||||
-- let spacebar allow me to fold the code
|
||||
-- nnoremap <space> za
|
||||
vim.keymap.set('n', '<space>', 'za')
|
||||
|
|
14
.config/nvim/lua/user/indent.lua
Normal file
14
.config/nvim/lua/user/indent.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
-- --------------------------------------------------------------------------
|
||||
-- INDENT ZONE
|
||||
-- --------------------------------------------------------------------------
|
||||
-- vim.opt.tabstop = 4
|
||||
vim.opt.tabstop = 8
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.autoindent = true
|
||||
|
||||
-- Enable file type detection. Use the default filetype settings, so that mail
|
||||
-- gets 'tw' set to 72, 'cindent' is on in C files, etc.
|
||||
-- Also load indent files, to automatically do language-dependent indenting.
|
||||
-- filetype plugin indent on
|
75
.config/nvim/lua/user/lsp-configs.lua
Normal file
75
.config/nvim/lua/user/lsp-configs.lua
Normal file
|
@ -0,0 +1,75 @@
|
|||
-- makes sure the language servers configured later with lspconfig are
|
||||
-- actually available, and install them automatically if they're not
|
||||
-- !! THIS MUST BE CALLED BEFORE ANY LANGUAGE SERVER CONFIGURATION
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup {
|
||||
-- automatically install language servers setup below for lspconfig
|
||||
automatic_installation = true
|
||||
}
|
||||
|
||||
-- all of the below are referenced from the neovim nvim-lspconfig repo
|
||||
-- ref: github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
|
||||
-- Setup the language servers so that they're available for our LSP client.
|
||||
local nvim_lsp = require('lspconfig')
|
||||
|
||||
-- ansible (may require npm install -g @ansible/ansible-language-server)
|
||||
nvim_lsp.ansiblels.setup{}
|
||||
|
||||
-- bash (may require npm i -g bash-language-server)
|
||||
nvim_lsp.bashls.setup{}
|
||||
|
||||
-- lua (may require brew install lua-language-server)
|
||||
nvim_lsp.lua_ls.setup{
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- version of Lua you're using (LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'},
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- docker (may require npm install -g dockerfile-language-server-nodejs)
|
||||
nvim_lsp.dockerls.setup{}
|
||||
|
||||
-- markdown (may require brew install marksman)
|
||||
nvim_lsp.marksman.setup{}
|
||||
|
||||
-- python
|
||||
nvim_lsp.jedi_language_server.setup{}
|
||||
|
||||
-- terraform
|
||||
nvim_lsp.terraformls.setup{}
|
||||
|
||||
-- Terraform linter that can act as lsp server.
|
||||
-- Installation ref: https://github.com/terraform-linters/tflint#installation
|
||||
-- nvim_lsp.tflint.setup{}
|
||||
|
||||
-- toml ( may require cargo install --features lsp --locked taplo-cli)
|
||||
nvim_lsp.taplo.setup{}
|
||||
|
||||
-- yaml - not sure if this is worth it yet
|
||||
-- github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls
|
||||
nvim_lsp.yamlls.setup {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0-standalone-strict/all.json"] = "/*.k8s.yaml",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
require('mini.map').setup()
|
|
@ -1,9 +1,9 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = { "lua", "yaml", "bash", "hcl", "python", "kdl", "toml" },
|
||||
-- ensure_installed = { "lua", "yaml", "bash", "hcl", "python", "kdl", "toml" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = true,
|
||||
-- sync_install = true,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
|
@ -12,9 +12,6 @@ require'nvim-treesitter.configs'.setup {
|
|||
-- List of parsers to ignore installing (for "all")
|
||||
-- ignore_install = { "toml"},
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
@ -31,4 +28,7 @@ require'nvim-treesitter.configs'.setup {
|
|||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,10 +84,13 @@ _G.packer_plugins = {
|
|||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/ale",
|
||||
url = "https://github.com/dense-analysis/ale"
|
||||
},
|
||||
["coc.nvim"] = {
|
||||
["barbecue.nvim"] = {
|
||||
config = { "\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rbarbecue\frequire\0" },
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/coc.nvim",
|
||||
url = "https://github.com/neoclide/coc.nvim"
|
||||
needs_bufread = false,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/opt/barbecue.nvim",
|
||||
url = "https://github.com/utilyre/barbecue.nvim"
|
||||
},
|
||||
["dashboard-nvim"] = {
|
||||
loaded = true,
|
||||
|
@ -107,6 +110,16 @@ _G.packer_plugins = {
|
|||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/limelight.vim",
|
||||
url = "https://github.com/junegunn/limelight.vim"
|
||||
},
|
||||
["mason-lspconfig.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
|
||||
url = "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
["mason.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/mason.nvim",
|
||||
url = "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
["nui.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/nui.nvim",
|
||||
|
@ -122,6 +135,16 @@ _G.packer_plugins = {
|
|||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/nvim-k8s",
|
||||
url = "https://github.com/hsalem7/nvim-k8s"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
loaded = true,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-navic"] = {
|
||||
loaded = true,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/nvim-navic",
|
||||
url = "https://github.com/SmiteshP/nvim-navic"
|
||||
},
|
||||
["nvim-scrollbar"] = {
|
||||
loaded = true,
|
||||
path = "/Users/jhitch/.local/share/nvim/site/pack/packer/start/nvim-scrollbar",
|
||||
|
@ -210,6 +233,15 @@ time([[Defining packer_plugins]], false)
|
|||
time([[Config for pretty-fold.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16pretty-fold\frequire\0", "config", "pretty-fold.nvim")
|
||||
time([[Config for pretty-fold.nvim]], false)
|
||||
-- Load plugins in order defined by `after`
|
||||
time([[Sequenced loading]], true)
|
||||
vim.cmd [[ packadd nvim-web-devicons ]]
|
||||
vim.cmd [[ packadd barbecue.nvim ]]
|
||||
|
||||
-- Config for: barbecue.nvim
|
||||
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rbarbecue\frequire\0", "config", "barbecue.nvim")
|
||||
|
||||
time([[Sequenced loading]], false)
|
||||
vim.cmd [[augroup packer_load_aucmds]]
|
||||
vim.cmd [[au!]]
|
||||
-- Event lazy-loads
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -42,6 +42,7 @@ cron
|
|||
.thumbnails
|
||||
ApkProjects
|
||||
Public
|
||||
.config/nvim/lua/.luarc.json
|
||||
|
||||
# this is just where I keep git cloned repos for things
|
||||
repos
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue