Tons of changes! Finally figured out custom snippets and I can get them going. Other items were organized.

This commit is contained in:
Norm Rasmussen
2023-09-08 16:55:00 -04:00
parent b3413957d3
commit 4069c13d0d
9 changed files with 93 additions and 55 deletions

View File

@ -3,7 +3,7 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--filteer=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
@ -12,12 +12,11 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = ','
vim.g.localmapleader = ','
vim.opt.textwidth = 85
--- vim.opt.textwidth = 85
vim.opt.colorcolumn = '+2'
require('lazy').setup('plugins')
-----------------------------------------------------------
-- General Neovim settings and configuration
-----------------------------------------------------------
@ -45,7 +44,7 @@ opt.shell = "/bin/zsh"
opt.updatetime = 200
opt.cursorline = true
g.markdown_folding = 1
-- opt.spell=true
opt.spell=true
opt.spelllang = 'en_us'
cmd [[ autocmd BufWritePre * :%s/\s\+$//e ]]
vim.api.nvim_set_hl(0, "ColorColumn", {guibg=DarkOrchid1})
@ -90,15 +89,19 @@ g.glow_border = 'rounded'
g.glow_width = 120
g.glow_use_pager = true
g.glow_style = 'dark'
-----------------------------------------------------------
-- MKDX Settings, mkdx#settings.
-- AutoCmd and Additional Function Settings.
-----------------------------------------------------------
-- 2 spaces for selected filetypes
cmd [[
autocmd FileType md,liquid,xml,html,xhtml,css,scss,javascript,lua,yaml setlocal shiftwidth=2 tabstop=8 noexpandtab
]]
vim.cmd [[
autocmd FileType md,liquid,xml,html,xhtml,css,scss,javascript,lua,yaml setlocal shiftwidth=2 tabstop=4 noexpandtab
]]
vim.cmd [[ autocmd FileType python set textwidth=110 ]]
vim.cmd [[ autocmd FileType lua set textwidth=80 ]]
vim.cmd [[ autocmd FileType markdown,text set textwidth=200 ]]
--[[
local disabled_built_ins = {
"netrw",
"netrwPlugin",
@ -122,11 +125,10 @@ local disabled_built_ins = {
for _, plugin in pairs(disabled_built_ins) do
vim.g["loaded_" .. plugin] = 1
end
--[[
Deletes all trailing whitespaces in a file if it's not binary nor a diff.
end
]]--
-- Deletes all trailing whitespaces in a file if it's not binary nor a diff.
function _G.trim_trailing_whitespaces()
if not o.binary and o.filetype ~= 'diff' then
local current_view = fn.winsaveview()
@ -143,7 +145,7 @@ else
end
-- see https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-dark-theme-colors-to-the-menu
vim.cmd[[
--[[vim.cmd[[
highlight! link CmpItemMenu Comment
" gray
highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=#808080
@ -162,6 +164,7 @@ vim.cmd[[
highlight! CmpItemKindProperty guibg=NONE guifg=#D4D4D4
highlight! CmpItemKindUnit guibg=NONE guifg=#D4D4D4
]]
--]]
require('core/keymaps')
vim.cmd[[colorscheme moonlight]]
vim.cmd[[colorscheme wildcharm]]

View File

@ -1,10 +1,11 @@
{
"LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" },
"adjacent.nvim": { "branch": "main", "commit": "a555ab92d61aa6fbbfa1bfaef4633b663563f04e" },
"alpha-nvim": { "branch": "main", "commit": "331d55eb18d6e42bda4a183863a681be3ee11370" },
"alpha-nvim": { "branch": "main", "commit": "712dc1dccd4fd515ef8bd126b3718f79d3e23b0d" },
"auto-hlsearch.nvim": { "branch": "main", "commit": "8f28246d53e9478717ca3b51c8112083fbebd7e3" },
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
@ -20,9 +21,10 @@
"feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
"gitsigns.nvim": { "branch": "main", "commit": "bf6b0bbc527c546ecd6af2bb9fcd06864ae0852c" },
"gitsigns.nvim": { "branch": "main", "commit": "983f1a216cca1a079399ba050bc4b9ce130de83a" },
"glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" },
"headlines.nvim": { "branch": "master", "commit": "74a083a3c32a08be24f7dfcc6f448ecf47857f46" },
"hover.nvim": { "branch": "main", "commit": "c366d1b0f9d6612d25681d3fea0f9ea46fa54f4d" },
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
@ -43,17 +45,17 @@
"nightfox.nvim": { "branch": "main", "commit": "e886e39e592e89f316536a6f070365a9d88901c9" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" },
"nvim": { "branch": "main", "commit": "1c15c5e51a998c9198d63c6d2b75e9d1e4a84541" },
"nvim": { "branch": "main", "commit": "a937d546f4783a1ff67f84043d2d7871ad4ecd83" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-dap": { "branch": "master", "commit": "31e1ece773e10448dcb616d5144290946a6264b7" },
"nvim-dap": { "branch": "master", "commit": "0e6b7c47dd70e80793ed39271b2aa712d9366dbc" },
"nvim-dap-python": { "branch": "master", "commit": "37b4cba02e337a95cb62ad1609b3d1dccb2e5d42" },
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
"nvim-lspconfig": { "branch": "master", "commit": "0517d8522dcec286b1dba47aa3ee1ed8f523aed6" },
"nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
"nvim-tree.lua": { "branch": "master", "commit": "ec33d4befa74205e09baf8bb4f90be5be754e6ab" },
"nvim-treesitter": { "branch": "master", "commit": "cc56e1f093868892fc7fea68ac3a51f5ffc38728" },
"nvim-treesitter": { "branch": "master", "commit": "80b4fa7970ee159e5c2c715bbcd386143c48dcb1" },
"nvim-web-devicons": { "branch": "master", "commit": "bc11ee2498de2310de5776477dd9dce65d03b464" },
"plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" },
"plenary.nvim": { "branch": "master", "commit": "a56bf0071bf63d35274fdc4738bb1e8821cfd2ea" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"sidebar.nvim": { "branch": "main", "commit": "990ce5f562c9125283ccac5473235b1a56fea6dc" },
"starry.nvim": { "branch": "master", "commit": "1373b0df5177a9c32802188befdba84502ef3073" },

View File

@ -0,0 +1,7 @@
{
"todays-date": {
"prefix": "today",
"body": ["${CURRENT_MONTH}-${CURRENT_DATE}-${CURRENT_YEAR}"],
"description": "Put the date in (Y-m-D) format"
}
}

View File

@ -0,0 +1,10 @@
{
"contributes": {
"snippets": [
{
"language": "markdown",
"path": "./markdown.json"
}
]
}
}

View File

@ -0,0 +1,27 @@
return {
"lewis6991/hover.nvim",
config = function()
require("hover").setup {
init = function()
require("hover.providers.lsp")
-- require('hover.providers.gh')
-- require('hover.providers.gh_user')
-- require('hover.providers.jira')
require('hover.providers.man')
require('hover.providers.dictionary')
end,
preview_opts = {
border = nil
},
-- Whether the contents of a currently open hover window should be moved
-- to a :h preview-window when pressing the hover keymap.
preview_window = false,
title = true
}
-- Setup keymaps
vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"})
vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"})
end
}

View File

@ -22,14 +22,19 @@ return {
{ 'neovim/nvim-lspconfig' },
{
'L3MON4D3/LuaSnip', version = "2.0.0",
'L3MON4D3/LuaSnip', version = "2.*",
build = "make install_jsregexp",
dependencies = { "friendly-snippets" },
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({
paths = { "~/.dotfiles/nvim/.config/nvim/lua/custom_snippets/" }
})
require("luasnip").setup({
history = true,
delete_check_events = "TextChanged",
})
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").load({
paths = {
"~/.dotfiles/nvim/.config/nvim/lua/custom_snippets/" }
})
end,
},
@ -91,6 +96,9 @@ return {
filters = {
dotfiles = true,
},
diagnostics = {
enable = true,
},
})
end,
},

View File

@ -14,13 +14,12 @@ return {
null_ls.setup({
debug = true,
sources = {
null_ls.builtins.completion.spell,
-- null_ls.builtins.completion.spell,
null_ls.builtins.diagnostics.markdownlint.with({
extra_args = { "--disable", "MD024", "MD013", "--" }}),
null_ls.builtins.formatting.black,
null_ls.builtins.completion.luasnip,
null_ls.builtins.code_actions.gitsigns,
null_ls.builtins.hover.dictionary,
},
})
end

View File

@ -8,6 +8,7 @@ return {
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline',
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-calc',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lsp-signature-help',
'f3fora/cmp-spell',
@ -88,12 +89,12 @@ return {
end,
},
sources = {
{ name = 'nvim-lsp', keyword_length = 1 },
{ name = 'luasnip', keyword_length = 1 },
{ name = 'nvim_lsp', },
{ name = 'luasnip', },
{ name = 'path' },
{ name = 'calc' },
{ name = 'nvim_lsp_signature_help' },
{ name = 'buffer', keyword_length = 1 },
{ name = 'buffer' },
},
formatting = {
fields = {'menu', 'abbr', 'kind'},
@ -103,6 +104,8 @@ return {
luasnip = '',
buffer = 'Ω',
path = '',
calc = '󰃬',
nvim_lsp_signature_help = '󰷼',
}
item.menu = menu_icon[entry.source.name]
return item
@ -122,7 +125,7 @@ return {
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
require'lspconfig'.pylsp.setup {
require'lspconfig'.pyright.setup {
capabilities = capabilities
}
end

View File

@ -1,34 +1,13 @@
# Path to your oh-my-zsh installation.
# export ZSH="$HOME/.oh-my-zsh"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
#plugins=(
# zsh-autosuggestions,
# git,
# wakatime,
# brew,
# npm,
# z,
# zsh-syntax-highlighting,
# vi-mode,
#)
plug "jeffreytse/zsh-vi-mode"
plug "wbingli/zsh-wakatime"
# Zsh Autosuggestion Config
#source ~/.dotfiles/zsh/zsh-autosuggestions/
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ff00ff,bg=cyan,bold,underline"
plug "zap-zsh/supercharge"
# plug "zap-zsh/supercharge"
plug "zsh-users/zsh-autosuggestions"
# Example install of a plugin pinned to specifc commit or branch, just pass the git reference
plug "zsh-users/zsh-syntax-highlighting" "122dc46"
# User configuration
export DOT="~/.dotfiles"
alias vim='vim -S ~/.vimrc'
alias nvim='nvim'
@ -71,10 +50,10 @@ alias nvim=nvimvenv
#bindkey -s ^a "nvims\n"
# source /Users/normrasmussen/.docker/init-zsh.sh || true # Added by Docker Desktop
# export PATH="$PATH:$HOME/.rvm/bin"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export PATH="/opt/homebrew/sbin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"
eval "$(starship init zsh)"
source ~/.dotfiles/zsh/.zshrc