mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 12:15:29 +00:00
feat: convert NeoVim configuration to Lua
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
nvim/plugin
|
||||
@@ -1,20 +1,20 @@
|
||||
-- Replace Caffeine.app with 18 lines of Lua :D
|
||||
local caffeine = hs.menubar.new()
|
||||
|
||||
function setCaffeineDisplay(state)
|
||||
local result
|
||||
if state then
|
||||
result = caffeine:setIcon("~/.hammerspoon/icons/sun.pdf")
|
||||
else
|
||||
result = caffeine:setIcon("~/.hammerspoon/icons/moon.pdf")
|
||||
end
|
||||
function SetCaffeineDisplay(state)
|
||||
local result
|
||||
if state then
|
||||
result = caffeine:setIcon("~/.hammerspoon/icons/sun.pdf")
|
||||
else
|
||||
result = caffeine:setIcon("~/.hammerspoon/icons/moon.pdf")
|
||||
end
|
||||
end
|
||||
|
||||
function caffeineClicked()
|
||||
setCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
|
||||
function CaffeineClicked()
|
||||
SetCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
|
||||
end
|
||||
|
||||
if caffeine then
|
||||
caffeine:setClickCallback(caffeineClicked)
|
||||
setCaffeineDisplay(hs.caffeinate.get("displayIdle"))
|
||||
caffeine:setClickCallback(CaffeineClicked)
|
||||
SetCaffeineDisplay(hs.caffeinate.get("displayIdle"))
|
||||
end
|
||||
|
||||
@@ -5,124 +5,122 @@
|
||||
-- Get list of screens and refresh that list whenever screens are plugged or unplugged:
|
||||
local screens = hs.screen.allScreens()
|
||||
local screenwatcher = hs.screen.watcher.new(function()
|
||||
screens = hs.screen.allScreens()
|
||||
screens = hs.screen.allScreens()
|
||||
end)
|
||||
screenwatcher:start()
|
||||
|
||||
|
||||
-- Move a window a number of pixels in x and y
|
||||
function nudge(xpos, ypos)
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
f.x = f.x + xpos
|
||||
f.y = f.y + ypos
|
||||
win:setFrame(f)
|
||||
function Nudge(xpos, ypos)
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
f.x = f.x + xpos
|
||||
f.y = f.y + ypos
|
||||
win:setFrame(f)
|
||||
end
|
||||
|
||||
|
||||
-- Resize a window by moving the bottom
|
||||
function yank(xpixels, ypixels)
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
function Yank(xpixels, ypixels)
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
|
||||
f.w = f.w + xpixels
|
||||
f.h = f.h + ypixels
|
||||
win:setFrame(f)
|
||||
f.w = f.w + xpixels
|
||||
f.h = f.h + ypixels
|
||||
win:setFrame(f)
|
||||
end
|
||||
|
||||
|
||||
-- Resize window for chunk of screen.
|
||||
-- For x and y: use 0 to expand fully in that dimension, 0.5 to expand halfway
|
||||
-- For w and h: use 1 for full, 0.5 for half
|
||||
function push(x, y, w, h)
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
function Push(x, y, w, h)
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x + (max.w*x)
|
||||
f.y = max.y + (max.h*y)
|
||||
f.w = max.w*w
|
||||
f.h = max.h*h
|
||||
win:setFrame(f)
|
||||
f.x = max.x + (max.w * x)
|
||||
f.y = max.y + (max.h * y)
|
||||
f.w = max.w * w
|
||||
f.h = max.h * h
|
||||
win:setFrame(f)
|
||||
end
|
||||
|
||||
|
||||
-- Move to monitor x. Checks to make sure monitor exists, if not moves to last monitor that exists
|
||||
function moveToMonitor(x)
|
||||
local win = hs.window.focusedWindow()
|
||||
local newScreen = nil
|
||||
while not newScreen do
|
||||
newScreen = screens[x]
|
||||
x = x-1
|
||||
end
|
||||
function MoveToMonitor(x)
|
||||
local win = hs.window.focusedWindow()
|
||||
local newScreen = nil
|
||||
while not newScreen do
|
||||
newScreen = screens[x]
|
||||
x = x - 1
|
||||
end
|
||||
|
||||
win:moveToScreen(newScreen)
|
||||
win:moveToScreen(newScreen)
|
||||
end
|
||||
|
||||
-- Move to next screen
|
||||
local function moveToNextScreen(win)
|
||||
win = win or window.focusedWindow()
|
||||
win:moveToScreen(win:screen():next())
|
||||
win = win or window.focusedWindow()
|
||||
win:moveToScreen(win:screen():next())
|
||||
end
|
||||
|
||||
-- Move to previous screen
|
||||
local function moveToPreviousScreen(win)
|
||||
win = win or window.focusedWindow()
|
||||
win:moveToScreen(win:screen():previous())
|
||||
win = win or window.focusedWindow()
|
||||
win:moveToScreen(win:screen():previous())
|
||||
end
|
||||
|
||||
-- This places a red circle around the mouse pointer
|
||||
local mouseCircle = nil
|
||||
local mouseCircleTimer = nil
|
||||
|
||||
function mouseHighlight()
|
||||
-- Delete an existing highlight if it exists
|
||||
if mouseCircle then
|
||||
mouseCircle:delete()
|
||||
if mouseCircleTimer then
|
||||
mouseCircleTimer:stop()
|
||||
end
|
||||
end
|
||||
-- Get the current co-ordinates of the mouse pointer
|
||||
mousepoint = hs.mouse.get()
|
||||
-- Prepare a big red circle around the mouse pointer
|
||||
mouseCircle = hs.drawing.circle(hs.geometry.rect(mousepoint.x-40, mousepoint.y-40, 80, 80))
|
||||
mouseCircle:setStrokeColor({["red"]=1,["blue"]=0,["green"]=0,["alpha"]=1})
|
||||
mouseCircle:setFill(false)
|
||||
mouseCircle:setStrokeWidth(5)
|
||||
mouseCircle:show()
|
||||
function MouseHighlight()
|
||||
-- Delete an existing highlight if it exists
|
||||
if mouseCircle then
|
||||
mouseCircle:delete()
|
||||
if mouseCircleTimer then
|
||||
mouseCircleTimer:stop()
|
||||
end
|
||||
end
|
||||
-- Get the current co-ordinates of the mouse pointer
|
||||
Mousepoint = hs.mouse.get()
|
||||
-- Prepare a big red circle around the mouse pointer
|
||||
mouseCircle = hs.drawing.circle(hs.geometry.rect(Mousepoint.x - 40, Mousepoint.y - 40, 80, 80))
|
||||
mouseCircle:setStrokeColor({ ["red"] = 1, ["blue"] = 0, ["green"] = 0, ["alpha"] = 1 })
|
||||
mouseCircle:setFill(false)
|
||||
mouseCircle:setStrokeWidth(5)
|
||||
mouseCircle:show()
|
||||
|
||||
-- Set a timer to delete the circle after 3 seconds
|
||||
mouseCircleTimer = hs.timer.doAfter(2, function() mouseCircle:delete() end)
|
||||
-- Set a timer to delete the circle after 3 seconds
|
||||
mouseCircleTimer = hs.timer.doAfter(2, function()
|
||||
mouseCircle:delete()
|
||||
end)
|
||||
end
|
||||
|
||||
-- Get all valid windows
|
||||
function getAllValidWindows()
|
||||
local allWindows = hs.window.allWindows()
|
||||
local windows = {}
|
||||
local index = 1
|
||||
for i = 1, #allWindows do
|
||||
local w = allWindows[i]
|
||||
if w:screen() then
|
||||
windows[index] = w
|
||||
index = index + 1
|
||||
end
|
||||
end
|
||||
return windows
|
||||
function GetAllValidWindows()
|
||||
local allWindows = hs.window.allWindows()
|
||||
local windows = {}
|
||||
local index = 1
|
||||
for i = 1, #allWindows do
|
||||
local w = allWindows[i]
|
||||
if w:screen() then
|
||||
windows[index] = w
|
||||
index = index + 1
|
||||
end
|
||||
end
|
||||
return windows
|
||||
end
|
||||
|
||||
-- Auto Reload Config
|
||||
function reloadConfig(files)
|
||||
doReload = false
|
||||
for _,file in pairs(files) do
|
||||
if file:sub(-4) == ".lua" then
|
||||
doReload = true
|
||||
end
|
||||
end
|
||||
if doReload then
|
||||
hs.reload()
|
||||
end
|
||||
function ReloadConfig(files)
|
||||
DoReload = false
|
||||
for _, file in pairs(files) do
|
||||
if file:sub(-4) == ".lua" then
|
||||
DoReload = true
|
||||
end
|
||||
end
|
||||
if DoReload then
|
||||
hs.reload()
|
||||
end
|
||||
end
|
||||
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start()
|
||||
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", ReloadConfig):start()
|
||||
hs.alert.show("Hammerspoon")
|
||||
|
||||
@@ -2,12 +2,11 @@ require("functions")
|
||||
require("caffeine")
|
||||
|
||||
local application = hs.application
|
||||
local window = hs.window
|
||||
local layout = hs.layout
|
||||
local screen = hs.screen
|
||||
local hotkey = hs.hotkey
|
||||
local hints = hs.hints
|
||||
|
||||
local window = hs.window
|
||||
local layout = hs.layout
|
||||
local screen = hs.screen
|
||||
local hotkey = hs.hotkey
|
||||
local hints = hs.hints
|
||||
|
||||
-------------------
|
||||
-- Configuration --
|
||||
@@ -17,8 +16,8 @@ local hints = hs.hints
|
||||
window.animationDuration = 0
|
||||
|
||||
-- Hints
|
||||
hints.fontName = "Helvetica-Bold"
|
||||
hints.fontSize = 18
|
||||
hints.fontName = "Helvetica-Bold"
|
||||
hints.fontSize = 18
|
||||
hints.showTitleThresh = 0
|
||||
-- hints.style = "vimperator" -- Buggy, gets slow after a while
|
||||
|
||||
@@ -30,28 +29,28 @@ application.enableSpotlightForNameSearches(true)
|
||||
------------
|
||||
|
||||
-- Keys
|
||||
local KEY_AM = { "⌥", "⌘" }
|
||||
local KEY_CA = { "⌃", "⌥" }
|
||||
local KEY_CAM = { "⌃", "⌥", "⌘" }
|
||||
local KEY_CM = { "⌃", "⌘" }
|
||||
local KEY_SAM = { "⇧", "⌥", "⌘" }
|
||||
local KEY_SC = { "⇧", "⌘" }
|
||||
local KEY_SCA = { "⇧", "⌃", "⌥" }
|
||||
local KEY_AM = { "⌥", "⌘" }
|
||||
local KEY_CA = { "⌃", "⌥" }
|
||||
local KEY_CAM = { "⌃", "⌥", "⌘" }
|
||||
local KEY_CM = { "⌃", "⌘" }
|
||||
local KEY_SAM = { "⇧", "⌥", "⌘" }
|
||||
local KEY_SC = { "⇧", "⌘" }
|
||||
local KEY_SCA = { "⇧", "⌃", "⌥" }
|
||||
local KEY_SCAM = { "⇧", "⌃", "⌥", "⌘" }
|
||||
local KEY_SCM = { "⇧", "⌃", "⌘" }
|
||||
local KEY_SCM = { "⇧", "⌃", "⌘" }
|
||||
|
||||
-- Displays
|
||||
local DISPLAY_PRIMARY = screen.primaryScreen()
|
||||
local DISPLAY_NOTEBOOK = "Color LCD"
|
||||
|
||||
-- Sizes
|
||||
local LEFT_MOST = hs.geometry.unitrect(0, 0, 0.6, 1)
|
||||
local LEFT_LESS = hs.geometry.unitrect(0, 0, 0.4, 1)
|
||||
local LEFT_MOST = hs.geometry.unitrect(0, 0, 0.6, 1)
|
||||
local LEFT_LESS = hs.geometry.unitrect(0, 0, 0.4, 1)
|
||||
local RIGHT_MOST = hs.geometry.unitrect(0.4, 0, 0.6, 1)
|
||||
local RIGHT_LESS = hs.geometry.unitrect(0.6, 0, 0.4, 1)
|
||||
local FULLSCREEN = hs.geometry.unitrect(0, 0, 1, 1)
|
||||
local RIGHT_HALF = hs.geometry.unitrect(0.5, 0, 0.5, 1)
|
||||
local LEFT_HALF = hs.geometry.unitrect(0, 0, 0.5, 1)
|
||||
local LEFT_HALF = hs.geometry.unitrect(0, 0, 0.5, 1)
|
||||
|
||||
-------------
|
||||
-- Layouts --
|
||||
@@ -62,44 +61,44 @@ local LEFT_HALF = hs.geometry.unitrect(0, 0, 0.5, 1)
|
||||
|
||||
-- One Monitor and Notebook
|
||||
local LAYOUT_DUAL = {
|
||||
{"Brave Browser", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Calendar", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Code", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"DEVONthink 3", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Element", nil, DISPLAY_NOTEBOOK, RIGHT_HALF, nil, nil},
|
||||
{"Firefox Developer Edition", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Mail", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Messages", nil, DISPLAY_PRIMARY, RIGHT_HALF, nil, nil},
|
||||
{"Microsoft Outlook", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Music", nil, DISPLAY_NOTEBOOK, FULLSCREEN, nil, nil},
|
||||
{"Obsidian", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Slack", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Sonos", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Telegram", nil, DISPLAY_PRIMARY, LEFT_HALF, nil, nil},
|
||||
{"Things", nil, DISPLAY_NOTEBOOK, FULLSCREEN, nil, nil},
|
||||
{"iA Writer", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"kitty", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{ "Brave Browser", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Calendar", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Code", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "DEVONthink 3", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Element", nil, DISPLAY_NOTEBOOK, RIGHT_HALF, nil, nil },
|
||||
{ "Firefox Developer Edition", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Mail", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Messages", nil, DISPLAY_PRIMARY, RIGHT_HALF, nil, nil },
|
||||
{ "Microsoft Outlook", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Music", nil, DISPLAY_NOTEBOOK, FULLSCREEN, nil, nil },
|
||||
{ "Obsidian", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Slack", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Sonos", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Telegram", nil, DISPLAY_PRIMARY, LEFT_HALF, nil, nil },
|
||||
{ "Things", nil, DISPLAY_NOTEBOOK, FULLSCREEN, nil, nil },
|
||||
{ "iA Writer", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "kitty", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
}
|
||||
|
||||
-- One Monitor
|
||||
local LAYOUT_SINGLE = {
|
||||
{"Brave Browser", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Calendar", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil},
|
||||
{"Code", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"DEVONthink 3", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Element", nil, DISPLAY_PRIMARY, RIGHT_HALF, nil, nil},
|
||||
{"Firefox Developer Edition", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Mail", nil, DISPLAY_PRIMARY, RIGHT_MOST, nil, nil},
|
||||
{"Messages", nil, DISPLAY_PRIMARY, RIGHT_LESS, nil, nil},
|
||||
{"Microsoft Outlook", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Music", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Obsidian", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Slack", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil},
|
||||
{"Sonos", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"Telegram", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil},
|
||||
{"Things", nil, DISPLAY_PRIMARY, RIGHT_LESS, nil, nil},
|
||||
{"iA Writer", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{"kitty", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil},
|
||||
{ "Brave Browser", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Calendar", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil },
|
||||
{ "Code", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "DEVONthink 3", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Element", nil, DISPLAY_PRIMARY, RIGHT_HALF, nil, nil },
|
||||
{ "Firefox Developer Edition", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Mail", nil, DISPLAY_PRIMARY, RIGHT_MOST, nil, nil },
|
||||
{ "Messages", nil, DISPLAY_PRIMARY, RIGHT_LESS, nil, nil },
|
||||
{ "Microsoft Outlook", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Music", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Obsidian", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Slack", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil },
|
||||
{ "Sonos", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "Telegram", nil, DISPLAY_PRIMARY, LEFT_MOST, nil, nil },
|
||||
{ "Things", nil, DISPLAY_PRIMARY, RIGHT_LESS, nil, nil },
|
||||
{ "iA Writer", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
{ "kitty", nil, DISPLAY_PRIMARY, FULLSCREEN, nil, nil },
|
||||
}
|
||||
|
||||
------------------
|
||||
@@ -113,36 +112,44 @@ local LAYOUT_SINGLE = {
|
||||
-- hotkey.bind(KEY_AM, "left", function() nudge(-100, 0) end)
|
||||
|
||||
-- Resize hotkeys
|
||||
hotkey.bind(KEY_SAM, "up", function() yank(0, -100) end)
|
||||
hotkey.bind(KEY_SAM, "down", function() yank(0, 100) end)
|
||||
hotkey.bind(KEY_SAM, "right", function() yank(100, 0) end)
|
||||
hotkey.bind(KEY_SAM, "left", function() yank(-100, 0) end)
|
||||
hotkey.bind(KEY_SAM, "up", function()
|
||||
Yank(0, -100)
|
||||
end)
|
||||
hotkey.bind(KEY_SAM, "down", function()
|
||||
Yank(0, 100)
|
||||
end)
|
||||
hotkey.bind(KEY_SAM, "right", function()
|
||||
Yank(100, 0)
|
||||
end)
|
||||
hotkey.bind(KEY_SAM, "left", function()
|
||||
Yank(-100, 0)
|
||||
end)
|
||||
|
||||
-- Push to screen edge (Moved to Raycast -- keep for later)
|
||||
-- hotkey.bind(KEY_CAM, "left", function() push(0, 0, 0.5, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "right", function() push(0.5, 0, 0.5, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "up", function() push(0, 0, 1, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "down", function() push(0, 0.5, 1, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "left", function() Push(0, 0, 0.5, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "right", function() Push(0.5, 0, 0.5, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "up", function() Push(0, 0, 1, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "down", function() Push(0, 0.5, 1, 0.5) end)
|
||||
|
||||
-- Centered window with some room to see the desktop (Moved to Raycast -- keep for later)
|
||||
-- hotkey.bind(KEY_SCM, "l", function() push(0.05, 0.05, 0.9, 0.9) end)
|
||||
-- hotkey.bind(KEY_SCM, "m", function() push(0.1, 0.1, 0.8, 0.8) end)
|
||||
-- hotkey.bind(KEY_SCM, "s", function() push(0.15, 0.15, 0.7, 0.7) end)
|
||||
-- hotkey.bind(KEY_SCM, "l", function() Push(0.05, 0.05, 0.9, 0.9) end)
|
||||
-- hotkey.bind(KEY_SCM, "m", function() Push(0.1, 0.1, 0.8, 0.8) end)
|
||||
-- hotkey.bind(KEY_SCM, "s", function() Push(0.15, 0.15, 0.7, 0.7) end)
|
||||
|
||||
-- Fullscreen (Moved to Raycast -- keep for later)
|
||||
-- hotkey.bind(KEY_CAM, "0", function() push(0, 0, 1, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "0", function() Push(0, 0, 1, 1) end)
|
||||
|
||||
-- Quarter Screens (Moved to Raycast -- keep for later)
|
||||
-- hotkey.bind(KEY_CAM, "q", function() push(0, 0, 0.5, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "w", function() push(0.5, 0, 0.5, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "a", function() push(0, 0.5, 0.5, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "s", function() push(0.5, 0.5, 0.5, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "q", function() Push(0, 0, 0.5, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "w", function() Push(0.5, 0, 0.5, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "a", function() Push(0, 0.5, 0.5, 0.5) end)
|
||||
-- hotkey.bind(KEY_CAM, "s", function() Push(0.5, 0.5, 0.5, 0.5) end)
|
||||
|
||||
-- Part Screens (Moved to Raycast -- keep for later)
|
||||
-- hotkey.bind(KEY_CAM, "4", function() push(0, 0, 0.6, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "5", function() push(0, 0, 0.4, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "6", function() push(0.4, 0, 0.6, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "7", function() push(0.6, 0, 0.4, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "4", function() Push(0, 0, 0.6, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "5", function() Push(0, 0, 0.4, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "6", function() Push(0.4, 0, 0.6, 1) end)
|
||||
-- hotkey.bind(KEY_CAM, "7", function() Push(0.6, 0, 0.4, 1) end)
|
||||
|
||||
-- Move a window between monitors (preserve size)
|
||||
-- hotkey.bind(KEY_CM, "1", function() window.focusedWindow():moveOneScreenNorth() end)
|
||||
@@ -189,10 +196,12 @@ hotkey.bind(KEY_SAM, "left", function() yank(-100, 0) end)
|
||||
-- hotkey.bind(KEY_SCAM, "Y", function() application.launchOrFocus("Music") end)
|
||||
|
||||
-- Place red circle around mouse
|
||||
hotkey.bind(KEY_SCAM, "space", mouseHighlight)
|
||||
hotkey.bind(KEY_SCAM, "space", MouseHighlight)
|
||||
|
||||
-- Manual config reloading (from getting started guide):
|
||||
hotkey.bind(KEY_CAM, "delete", function() hs.reload() end)
|
||||
hotkey.bind(KEY_CAM, "delete", function()
|
||||
hs.reload()
|
||||
end)
|
||||
|
||||
-- Focus (Moved to Raycast -- keep for later)
|
||||
-- hotkey.bind(KEY_CAM, 'k', function() window.focusedWindow():focusWindowNorth() end)
|
||||
@@ -201,8 +210,14 @@ hotkey.bind(KEY_CAM, "delete", function() hs.reload() end)
|
||||
-- hotkey.bind(KEY_CAM, 'h', function() window.focusedWindow():focusWindowWest() end)
|
||||
|
||||
-- Hints
|
||||
hotkey.bind(KEY_CAM, "space", function() hints.windowHints(getAllValidWindows()) end)
|
||||
hotkey.bind(KEY_CAM, "space", function()
|
||||
hints.windowHints(GetAllValidWindows())
|
||||
end)
|
||||
|
||||
-- Layouts
|
||||
hotkey.bind(KEY_SCAM, "1", function() layout.apply(LAYOUT_SINGLE) end)
|
||||
hotkey.bind(KEY_SCAM, "2", function() layout.apply(LAYOUT_DUAL) end)
|
||||
hotkey.bind(KEY_SCAM, "1", function()
|
||||
layout.apply(LAYOUT_SINGLE)
|
||||
end)
|
||||
hotkey.bind(KEY_SCAM, "2", function()
|
||||
layout.apply(LAYOUT_DUAL)
|
||||
end)
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Abolish teh the
|
||||
Abolish {despa,sepe}rat{e,es,ed,ing,ely,ion,ions,or} {despe,sepa}rat{}
|
||||
|
||||
108
nvim/autocmd.vim
108
nvim/autocmd.vim
@@ -1,108 +0,0 @@
|
||||
" *** *** *** Autocommands *** *** ***
|
||||
" ************************************
|
||||
|
||||
" Automatically highlight yanked content
|
||||
augroup highlight_yank
|
||||
autocmd!
|
||||
autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=700}
|
||||
augroup END
|
||||
|
||||
" Remember cursor position
|
||||
augroup line_return
|
||||
autocmd!
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 1 && line("'\"") <= line("$") |
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
augroup END
|
||||
|
||||
" HTML
|
||||
augroup ft_html
|
||||
autocmd!
|
||||
autocmd FileType html,eruby,njk setlocal foldmethod=indent
|
||||
autocmd FileType html,eruby,njk setlocal omnifunc=htmlcomplete#CompleteTags
|
||||
autocmd Filetype html,eruby,njk setlocal ts=2 sts=2 sw=2 expandtab
|
||||
augroup END
|
||||
|
||||
" CSS
|
||||
augroup ft_css
|
||||
autocmd!
|
||||
autocmd FileType css setlocal foldmethod=marker
|
||||
autocmd FileType scss,sass,less,stylus setlocal foldmethod=indent
|
||||
autocmd FileType css setlocal foldmarker={,}
|
||||
autocmd FileType css,scss,sass,less,stylus setlocal omnifunc=csscomplete#CompleteCSS
|
||||
autocmd Filetype css,scss,sass,less,stylus setlocal iskeyword+=-
|
||||
autocmd Filetype css,scss,sass,less,stylus setlocal ts=2 sts=2 sw=2 expandtab
|
||||
augroup END
|
||||
|
||||
" XML
|
||||
augroup ft_xml
|
||||
autocmd!
|
||||
autocmd FileType xml setlocal foldmethod=indent
|
||||
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
|
||||
autocmd Filetype xml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
augroup END
|
||||
|
||||
" JavaScript
|
||||
augroup ft_javascript
|
||||
autocmd!
|
||||
autocmd FileType javascript setlocal foldmethod=indent
|
||||
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||
autocmd FileType javascript setlocal ts=2 sts=2 sw=2 expandtab
|
||||
autocmd BufRead,BufNewFile *.es6 setfiletype javascript
|
||||
autocmd BufRead,BufNewFile *.jsx setfiletype javascript.jsx
|
||||
augroup END
|
||||
|
||||
" JSON
|
||||
augroup ft_json
|
||||
autocmd!
|
||||
autocmd FileType json syntax match Comment +\/\/.\+$+
|
||||
augroup END
|
||||
|
||||
" Ruby
|
||||
augroup ft_ruby
|
||||
autocmd!
|
||||
autocmd FileType ruby setlocal foldmethod=syntax
|
||||
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
|
||||
autocmd FileType ruby let g:rubycomplete_buffer_loading = 1
|
||||
autocmd FileType ruby let g:rubycomplete_rails = 1
|
||||
autocmd FileType ruby let g:rubycomplete_classes_in_global = 1
|
||||
augroup END
|
||||
|
||||
" Pandoc
|
||||
augroup ft_pandoc
|
||||
autocmd!
|
||||
autocmd BufNewFile,BufFilePRe,BufRead *.pdc set filetype=markdown.pandoc
|
||||
autocmd BufNewFile,BufFilePRe,BufRead *.md set filetype=markdown.pandoc
|
||||
autocmd BufNewFile,BufFilePRe,BufRead *.markdown set filetype=markdown.pandoc
|
||||
augroup END
|
||||
|
||||
" Vim
|
||||
augroup ft_vim
|
||||
autocmd!
|
||||
autocmd FileType vim setlocal foldmethod=marker
|
||||
augroup END
|
||||
|
||||
" PHP
|
||||
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
|
||||
|
||||
" Git commit messages syntax
|
||||
autocmd BufRead,BufNewFile COMMIT_EDITMSG setfiletype git
|
||||
|
||||
" Makefile
|
||||
autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
|
||||
|
||||
" Yaml
|
||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
|
||||
" Misc file types
|
||||
autocmd BufNewFile,BufRead *.handlebars set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.hb set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.hbs set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.njk set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
||||
autocmd BufNewFile,BufRead *.pcss set filetype=css syntax=scss
|
||||
autocmd BufNewFile,BufRead *.postcss set filetype=css syntax=scss
|
||||
autocmd BufNewFile,BufRead *.rss set filetype=xml
|
||||
autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart
|
||||
autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear
|
||||
@@ -1,35 +0,0 @@
|
||||
" *** *** *** Functions *** *** ***
|
||||
" *********************************
|
||||
|
||||
" Toggle between soft wrap and no wrap
|
||||
nnoremap <leader>tw :call ToggleWrap()<CR>
|
||||
|
||||
function! ToggleWrap()
|
||||
if &wrap
|
||||
echo "Wrap OFF"
|
||||
set nowrap
|
||||
set nolinebreak
|
||||
set virtualedit=all
|
||||
else
|
||||
echo "Wrap ON"
|
||||
set wrap
|
||||
set linebreak
|
||||
set virtualedit=
|
||||
setlocal display+=lastline
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Toggle between soft wrap and no wrap
|
||||
nnoremap <leader>cw :call ToggleColorColumn()<CR>
|
||||
|
||||
function! ToggleColorColumn()
|
||||
if &colorcolumn == "80"
|
||||
echo "Textwidth OFF"
|
||||
set colorcolumn=0
|
||||
set textwidth=0
|
||||
else
|
||||
echo "Textwidth ON"
|
||||
set colorcolumn=80
|
||||
set textwidth=80
|
||||
endif
|
||||
endfunction
|
||||
38
nvim/init.lua
Normal file
38
nvim/init.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
require("kogakure.options")
|
||||
require("kogakure.keymaps")
|
||||
require("kogakure.plugins")
|
||||
require("kogakure.colorscheme")
|
||||
require("kogakure.cmp")
|
||||
require("kogakure.lsp")
|
||||
require("kogakure.telescope")
|
||||
require("kogakure.fzf")
|
||||
require("kogakure.treesitter")
|
||||
require("kogakure.autopairs")
|
||||
require("kogakure.comment")
|
||||
require("kogakure.harpoon")
|
||||
require("kogakure.gitsigns")
|
||||
require("kogakure.nvim-tree")
|
||||
require("kogakure.bufferline")
|
||||
require("kogakure.lualine")
|
||||
require("kogakure.toggleterm")
|
||||
require("kogakure.colorizer")
|
||||
require("kogakure.project")
|
||||
require("kogakure.impatient")
|
||||
require("kogakure.indentline")
|
||||
require("kogakure.alpha")
|
||||
require("kogakure.whichkey")
|
||||
require("kogakure.cursorline")
|
||||
require("kogakure.neoscroll")
|
||||
require("kogakure.blamer")
|
||||
require("kogakure.vim-gh-line")
|
||||
require("kogakure.export-to-vscode")
|
||||
require("kogakure.spectre")
|
||||
require("kogakure.speeddating")
|
||||
require("kogakure.goyo")
|
||||
require("kogakure.vim-easymotion")
|
||||
require("kogakure.vimux")
|
||||
require("kogakure.functions")
|
||||
require("kogakure.autocommands")
|
||||
|
||||
require("kogakure/text-objects").basic_text_objects()
|
||||
require("kogakure/text-objects").indent_text_objects()
|
||||
@@ -1,6 +0,0 @@
|
||||
source ~/.config/nvim/settings.vim
|
||||
source ~/.config/nvim/mappings.vim
|
||||
source ~/.config/nvim/functions.vim
|
||||
source ~/.config/nvim/plugins.vim
|
||||
source ~/.config/nvim/plugin-config.vim
|
||||
source ~/.config/nvim/autocmd.vim
|
||||
35
nvim/lua/kogakure/alpha.lua
Normal file
35
nvim/lua/kogakure/alpha.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
-- alpha-nvim – https://github.com/goolord/alpha-nvim
|
||||
local status_ok, alpha = pcall(require, "alpha")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
[[╔════════════════════════╗]],
|
||||
[[║ ╭────────────╮ ║]],
|
||||
[[║ │ ﱲ 木隠 ﱲ │ ║]],
|
||||
[[║ ╰────────────╯ ║]],
|
||||
[[║ ﯤ ║]],
|
||||
[[╚════════════════════════╝]],
|
||||
}
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " Find Files", ":FzfLua files<CR>"),
|
||||
dashboard.button("e", " New File", ":ene <BAR> startinsert<CR>"),
|
||||
dashboard.button("p", " Find Project", ":Telescope projects<CR>"),
|
||||
dashboard.button("r", " Recently Used Files", ":FzfLua oldfiles<CR>"),
|
||||
dashboard.button("t", " Find Text", ":FzfLua live_grep<CR>"),
|
||||
dashboard.button("b", " Browser Bookmarks", ":Telescope bookmarks<CR>"),
|
||||
dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua<CR>"),
|
||||
dashboard.button("u", " Update Plugins", ":PackerUpdate<CR>"),
|
||||
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.opts.hl = "Type"
|
||||
dashboard.section.header.opts.hl = "Include"
|
||||
dashboard.section.buttons.opts.hl = "Keyword"
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
117
nvim/lua/kogakure/autocommands.lua
Normal file
117
nvim/lua/kogakure/autocommands.lua
Normal file
@@ -0,0 +1,117 @@
|
||||
vim.cmd([[
|
||||
augroup _general_settings
|
||||
autocmd!
|
||||
autocmd FileType qf,help,man,lspinfo nnoremap <silent> <buffer> q :close<CR>
|
||||
autocmd BufWinEnter * :set formatoptions-=cro
|
||||
autocmd FileType qf set nobuflisted
|
||||
augroup end
|
||||
|
||||
" Automatically highlight yanked content
|
||||
augroup _highlight_yank
|
||||
autocmd!
|
||||
autocmd TextYankPost * silent! lua vim.highlight.on_yank({higroup = 'Visual', timeout = 700})
|
||||
augroup END
|
||||
|
||||
" Remember cursor position
|
||||
augroup _line_return
|
||||
autocmd!
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 1 && line("'\"") <= line("$") |
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
augroup END
|
||||
|
||||
augroup _git
|
||||
autocmd!
|
||||
autocmd FileType gitcommit setlocal wrap
|
||||
autocmd FileType gitcommit setlocal spell
|
||||
autocmd BufRead,BufNewFile COMMIT_EDITMSG setfiletype git
|
||||
augroup end
|
||||
|
||||
augroup _markdown
|
||||
autocmd!
|
||||
autocmd FileType markdown setlocal wrap
|
||||
autocmd FileType markdown setlocal spell
|
||||
augroup end
|
||||
|
||||
augroup _ft_html
|
||||
autocmd!
|
||||
autocmd FileType html,eruby,njk setlocal foldmethod=indent
|
||||
autocmd FileType html,eruby,njk setlocal omnifunc=htmlcomplete#CompleteTags
|
||||
autocmd Filetype html,eruby,njk setlocal ts=2 sts=2 sw=2 expandtab
|
||||
augroup END
|
||||
|
||||
augroup _ft_css
|
||||
autocmd!
|
||||
autocmd FileType css setlocal foldmethod=marker
|
||||
autocmd FileType scss,sass,less,stylus setlocal foldmethod=indent
|
||||
autocmd FileType css setlocal foldmarker={,}
|
||||
autocmd FileType css,scss,sass,less,stylus setlocal omnifunc=csscomplete#CompleteCSS
|
||||
autocmd Filetype css,scss,sass,less,stylus setlocal iskeyword+=-
|
||||
autocmd Filetype css,scss,sass,less,stylus setlocal ts=2 sts=2 sw=2 expandtab
|
||||
augroup END
|
||||
|
||||
augroup _ft_xml
|
||||
autocmd!
|
||||
autocmd FileType xml setlocal foldmethod=indent
|
||||
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
|
||||
autocmd Filetype xml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
augroup END
|
||||
|
||||
augroup _ft_javascript
|
||||
autocmd!
|
||||
autocmd FileType javascript setlocal foldmethod=indent
|
||||
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||
autocmd FileType javascript setlocal ts=2 sts=2 sw=2 expandtab
|
||||
autocmd BufRead,BufNewFile *.es6 setfiletype javascript
|
||||
autocmd BufRead,BufNewFile *.jsx setfiletype javascript.jsx
|
||||
augroup END
|
||||
|
||||
augroup _ft_json
|
||||
autocmd!
|
||||
autocmd FileType json syntax match Comment +\/\/.\+$+
|
||||
augroup END
|
||||
|
||||
augroup _ft_ruby
|
||||
autocmd!
|
||||
autocmd FileType ruby setlocal foldmethod=syntax
|
||||
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
|
||||
autocmd FileType ruby let g:rubycomplete_buffer_loading = 1
|
||||
autocmd FileType ruby let g:rubycomplete_rails = 1
|
||||
autocmd FileType ruby let g:rubycomplete_classes_in_global = 1
|
||||
augroup END
|
||||
|
||||
augroup _ft_vim
|
||||
autocmd!
|
||||
autocmd FileType vim setlocal foldmethod=marker
|
||||
augroup END
|
||||
|
||||
augroup _ft_misc
|
||||
autocmd!
|
||||
autocmd BufNewFile,BufRead *.handlebars set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.hb set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.hbs set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.njk set filetype=html syntax=handlebars
|
||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
||||
autocmd BufNewFile,BufRead *.pcss set filetype=css syntax=scss
|
||||
autocmd BufNewFile,BufRead *.postcss set filetype=css syntax=scss
|
||||
autocmd BufNewFile,BufRead *.rss set filetype=xml
|
||||
autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart
|
||||
autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear
|
||||
augroup END
|
||||
|
||||
augroup _auto_resize
|
||||
autocmd!
|
||||
autocmd VimResized * tabdo wincmd =
|
||||
augroup end
|
||||
|
||||
augroup _alpha
|
||||
autocmd!
|
||||
autocmd User AlphaReady set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
|
||||
augroup end
|
||||
|
||||
augroup _lsp
|
||||
autocmd!
|
||||
autocmd BufWritePre * lua vim.lsp.buf.formatting()
|
||||
augroup end
|
||||
]])
|
||||
34
nvim/lua/kogakure/autopairs.lua
Normal file
34
nvim/lua/kogakure/autopairs.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
-- nvim-autopairs – https://github.com/windwp/nvim-autopairs
|
||||
local status_ok, autopairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
autopairs.setup {
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
fast_wrap = {
|
||||
map = "<C-l>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertzuiopyxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
}
|
||||
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
|
||||
10
nvim/lua/kogakure/blamer.lua
Normal file
10
nvim/lua/kogakure/blamer.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
-- blamer.vim – https://github.com/APZelos/blamer.nvim
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.g.blamer_enabled = 0
|
||||
vim.g.blamer_relative_time = 1
|
||||
vim.g.blamer_delay = 200
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>tb", [[<Cmd>BlamerToggle<CR>]], opts)
|
||||
71
nvim/lua/kogakure/bufferline.lua
Normal file
71
nvim/lua/kogakure/bufferline.lua
Normal file
@@ -0,0 +1,71 @@
|
||||
-- bufferline.nvim – https://github.com/akinsho/bufferline.nvim
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup({
|
||||
highlights = {
|
||||
fill = {
|
||||
guibg = "#282828",
|
||||
},
|
||||
tab_selected = {
|
||||
guifg = {
|
||||
attribute = "fg",
|
||||
highlight = "Normal",
|
||||
},
|
||||
guibg = {
|
||||
attribute = "bg",
|
||||
highlight = "Normal",
|
||||
},
|
||||
},
|
||||
tab = {
|
||||
guifg = {
|
||||
attribute = "fg",
|
||||
highlight = "TabLine",
|
||||
},
|
||||
guibg = {
|
||||
attribute = "bg",
|
||||
highlight = "TabLine",
|
||||
},
|
||||
},
|
||||
indicator_selected = {
|
||||
guifg = {
|
||||
attribute = "fg",
|
||||
highlight = "LspDiagnosticsDefaultHint",
|
||||
},
|
||||
guibg = {
|
||||
attribute = "bg",
|
||||
highlight = "Normal",
|
||||
},
|
||||
},
|
||||
},
|
||||
options = {
|
||||
modified_icon = "●",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
max_name_length = 25,
|
||||
max_prefix_length = 25,
|
||||
enforce_regular_tabs = false,
|
||||
view = "multiwindow",
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
separator_style = "thin",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
return "(" .. count .. ")"
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
139
nvim/lua/kogakure/cmp.lua
Normal file
139
nvim/lua/kogakure/cmp.lua
Normal file
@@ -0,0 +1,139 @@
|
||||
-- nvim-cmp – https://github.com/hrsh7th/nvim-cmp
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.fn.col(".") - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||
end
|
||||
|
||||
-- פּ ﯟ some other good icons
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = "m",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
}
|
||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-x>"] = cmp.mapping.complete(),
|
||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
["<C-e>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
-- Accept currently selected item. If none selected, `select` first item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
select = true,
|
||||
}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif check_backspace() then
|
||||
fallback()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
-- vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[Snippet]",
|
||||
buffer = "[Buffer]",
|
||||
path = "[Path]",
|
||||
spell = "[Spell]",
|
||||
dictionary = "[Dictionary]",
|
||||
omni = "[Omni]",
|
||||
nvim_lua = "[Nvim Lua]",
|
||||
npm = "[npm]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "spell" },
|
||||
{ name = "dictionary" },
|
||||
{ name = "omni" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "npm", keyword_length = 4 },
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
native_menu = false,
|
||||
},
|
||||
})
|
||||
21
nvim/lua/kogakure/colorizer.lua
Normal file
21
nvim/lua/kogakure/colorizer.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
-- colorizer.lua – https://github.com/norcalli/nvim-colorizer.lua
|
||||
local status, colorizer = pcall(require, "colorizer")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
colorizer.setup({
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
}, {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
names = true, -- "Name" codes like Blue
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
mode = "background", -- Set the display mode.)
|
||||
})
|
||||
13
nvim/lua/kogakure/colorscheme.lua
Normal file
13
nvim/lua/kogakure/colorscheme.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
-- Colorscheme
|
||||
local source = "~/.vimrc_background"
|
||||
local status_ok, _ = pcall(vim.cmd, "source " .. source)
|
||||
|
||||
if not status_ok then
|
||||
vim.notify("Error sourcing " .. source)
|
||||
return
|
||||
end
|
||||
|
||||
vim.cmd([[
|
||||
highlight ColorColumn guibg=#202224
|
||||
highlight SpellBad guifg=red
|
||||
]])
|
||||
23
nvim/lua/kogakure/comment.lua
Normal file
23
nvim/lua/kogakure/comment.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
-- Comment.nvim – https://github.com/numToStr/comment.nvim
|
||||
local status_ok, comment = pcall(require, "Comment")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
comment.setup {
|
||||
pre_hook = function(ctx)
|
||||
local U = require "Comment.utils"
|
||||
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.block then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring {
|
||||
key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
|
||||
location = location,
|
||||
}
|
||||
end
|
||||
}
|
||||
18
nvim/lua/kogakure/cursorline.lua
Normal file
18
nvim/lua/kogakure/cursorline.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-- nvim-cursorline – https://github.com/yamatsum/nvim-cursorline
|
||||
local status, cursorline = pcall(require, "nvim-cursorline")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
cursorline.setup({
|
||||
cursorline = {
|
||||
enable = true,
|
||||
timeout = 1000,
|
||||
number = false,
|
||||
},
|
||||
cursorword = {
|
||||
enable = true,
|
||||
min_length = 3,
|
||||
hl = { underline = true },
|
||||
},
|
||||
})
|
||||
6
nvim/lua/kogakure/export-to-vscode.lua
Normal file
6
nvim/lua/kogakure/export-to-vscode.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
--- export-to-vscode.nvim – https://github.com/elijahmanor/export-to-vscode.nvim
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>code", [[<Cmd>lua require("export-to-vscode").launch()<CR>]], opts)
|
||||
51
nvim/lua/kogakure/functions.lua
Normal file
51
nvim/lua/kogakure/functions.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
local cfg = vim.fn.stdpath("config")
|
||||
|
||||
vim.cmd([[
|
||||
function! ToggleWrap()
|
||||
if &wrap
|
||||
echo "Wrap OFF"
|
||||
set nowrap
|
||||
set nolinebreak
|
||||
set virtualedit=all
|
||||
else
|
||||
echo "Wrap ON"
|
||||
set wrap
|
||||
set linebreak
|
||||
set virtualedit=
|
||||
setlocal display+=lastline
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ToggleColorColumn()
|
||||
if &colorcolumn == "80"
|
||||
echo "Textwidth OFF"
|
||||
set colorcolumn=0
|
||||
set textwidth=0
|
||||
else
|
||||
echo "Textwidth ON"
|
||||
set colorcolumn=80
|
||||
set textwidth=80
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SpellEn()
|
||||
set spell
|
||||
set spelllang=en_us
|
||||
set spellfile=~/.config/nvim/spell/en.utf-8.add
|
||||
endfunction
|
||||
|
||||
function! SpellDe()
|
||||
set spell
|
||||
set spelllang=de_de
|
||||
set spellfile=~/.config/nvim/spell/de.utf-8.add
|
||||
endfunction
|
||||
]])
|
||||
|
||||
-- Keymaps
|
||||
-- Toggle between soft wrap and no wrap
|
||||
keymap("n", "<leader>tw", [[<cmd>call ToggleWrap()<CR>]], opts)
|
||||
|
||||
-- Toggle between soft wrap and no wrap
|
||||
keymap("n", "<leader>tcc", [[<cmd>call ToggleColorColumn()<CR>]], opts)
|
||||
44
nvim/lua/kogakure/fzf.lua
Normal file
44
nvim/lua/kogakure/fzf.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
-- fzf-lua – https://github.com/ibhagwan/fzf-lua
|
||||
local cmp_status_ok, fzf_lua = pcall(require, "fzf-lua")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
fzf_lua.setup({
|
||||
lsp = {
|
||||
async_or_timeout = 3000, -- make lsp requests synchronous so they work with null-ls
|
||||
},
|
||||
})
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<C-p>", [[<Cmd>:FzfLua files<CR>]], opts)
|
||||
keymap("n", "<leader>b", [[<Cmd>:FzfLua buffers<CR>]], opts)
|
||||
keymap("n", "<leader>zbl", [[<Cmd>:FzfLua blines<CR>]], opts)
|
||||
keymap("n", "<leader>zf", [[<Cmd>:FzfLua files<CR>]], opts)
|
||||
keymap("n", "<leader>zg", [[<Cmd>:FzfLua grep<CR>]], opts)
|
||||
keymap("n", "<leader>zgb", [[<Cmd>:FzfLua git_branches<CR>]], opts)
|
||||
keymap("n", "<leader>zgc", [[<Cmd>:FzfLua git_commits<CR>]], opts)
|
||||
keymap("n", "<leader>zgl", [[<Cmd>:FzfLua grep_last<CR>]], opts)
|
||||
keymap("n", "<leader>zgp", [[<Cmd>:FzfLua grep_project<CR>]], opts)
|
||||
keymap("n", "<leader>zgs", [[<Cmd>:FzfLua git_status<CR>]], opts)
|
||||
keymap("n", "<leader>zgst", [[<Cmd>:FzfLua git_stash<CR>]], opts)
|
||||
keymap("n", "<leader>zgv", [[<Cmd>:FzfLua grep_visual<CR>]], opts)
|
||||
keymap("n", "<leader>zgw", [[<Cmd>:FzfLua grep_cword<CR>]], opts)
|
||||
keymap("n", "<leader>zh", [[<Cmd>:FzfLua oldfiles<CR>]], opts)
|
||||
keymap("n", "<leader>zl", [[<Cmd>:FzfLua lines<CR>]], opts)
|
||||
keymap("n", "<leader>zlca", [[<Cmd>:FzfLua code_actions<CR>]], opts)
|
||||
keymap("n", "<leader>zld", [[<Cmd>:FzfLua lsp_definitions<CR>]], opts)
|
||||
keymap("n", "<leader>zlds", [[<Cmd>:FzfLua lsp_document_symbols<CR>]], opts)
|
||||
keymap("n", "<leader>zlg", [[<Cmd>:FzfLua live_grep<CR>]], opts)
|
||||
keymap("n", "<leader>zlgr", [[<Cmd>:FzfLua live_grep_resume<CR>]], opts)
|
||||
keymap("n", "<leader>zlr", [[<Cmd>:FzfLua lsp_references<CR>]], opts)
|
||||
keymap("n", "<leader>zltd", [[<Cmd>:FzfLua lsp_typedef<CR>]], opts)
|
||||
keymap("n", "<leader>zlws", [[<Cmd>:FzfLua lsp_live_workspace_symbols<CR>]], opts)
|
||||
keymap("n", "<leader>zm", [[<Cmd>:FzfLua marks<CR>]], opts)
|
||||
keymap("n", "<leader>zqfq", [[<Cmd>:FzfLua quickfix<CR>]], opts)
|
||||
keymap("n", "<leader>zr", [[<Cmd>:FzfLua resume<CR>]], opts)
|
||||
keymap("n", "<leader>zss", [[<Cmd>:FzfLua spell_suggest<CR>]], opts)
|
||||
keymap("n", "<leader>ztg", [[<Cmd>:FzfLua tabs<CR>]], opts)
|
||||
49
nvim/lua/kogakure/gitsigns.lua
Normal file
49
nvim/lua/kogakure/gitsigns.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
-- gitsigns.nvim – https://github.com/lewis6991/gitsigns.nvim
|
||||
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup({
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "▎", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "▎", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- "eol" | "overlay" | "right_align"
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = {
|
||||
enable = false,
|
||||
},
|
||||
})
|
||||
@@ -1,6 +1,8 @@
|
||||
" Goyo
|
||||
" https://github.com/junegunn/goyo.vim
|
||||
-- Goyo – https://github.com/junegunn/goyo.vim
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.cmd([[
|
||||
function! s:goyo_enter()
|
||||
if executable('tmux') && strlen($TMUX)
|
||||
silent !tmux set status off
|
||||
@@ -25,6 +27,4 @@ endfunction
|
||||
|
||||
autocmd! User GoyoEnter nested call <SID>goyo_enter()
|
||||
autocmd! User GoyoLeave nested call <SID>goyo_leave()
|
||||
|
||||
" Mappings
|
||||
noremap <leader>z :Goyo<CR>
|
||||
]])
|
||||
18
nvim/lua/kogakure/harpoon.lua
Normal file
18
nvim/lua/kogakure/harpoon.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Harpoon – https://github.com/ThePrimeagen/harpoon
|
||||
local status, harpoon = pcall(require, "harpoon")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
harpoon.setup()
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>a", [[<Cmd>lua require("harpoon.mark").add_file()<CR>]], opts)
|
||||
keymap("n", "<leader>,", [[<Cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>]], opts)
|
||||
keymap("n", "<leader>1", [[<Cmd>lua require("harpoon.ui").nav_file(1)<CR>]], opts)
|
||||
keymap("n", "<leader>2", [[<Cmd>lua require("harpoon.ui").nav_file(2)<CR>]], opts)
|
||||
keymap("n", "<leader>3", [[<Cmd>lua require("harpoon.ui").nav_file(3)<CR>]], opts)
|
||||
keymap("n", "<leader>4", [[<Cmd>lua require("harpoon.ui").nav_file(4)<CR>]], opts)
|
||||
7
nvim/lua/kogakure/impatient.lua
Normal file
7
nvim/lua/kogakure/impatient.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
-- impatient.nvim – https://github.com/lewis6991/impatient.nvim
|
||||
local status_ok, impatient = pcall(require, "impatient")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
impatient.enable_profile()
|
||||
24
nvim/lua/kogakure/indentline.lua
Normal file
24
nvim/lua/kogakure/indentline.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- Indent Blankline – https://github.com/lukas-reineke/indent-blankline.nvim
|
||||
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
vim.cmd([[
|
||||
highlight IndentBlanklineIndent1 guibg=#1f1f1f gui=nocombine
|
||||
highlight IndentBlanklineIndent2 guibg=#1a1a1a gui=nocombine
|
||||
]])
|
||||
|
||||
indent_blankline.setup({
|
||||
char = "",
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
},
|
||||
space_char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
},
|
||||
show_trailing_blankline_indent = false,
|
||||
})
|
||||
130
nvim/lua/kogakure/keymaps.lua
Normal file
130
nvim/lua/kogakure/keymaps.lua
Normal file
@@ -0,0 +1,130 @@
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
--- Remap space as <leader> key
|
||||
keymap("", "<space>", "<Nop>", opts)
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Quick toggle between buffers
|
||||
keymap("n", "<leader>j", ":b#<CR>", opts)
|
||||
|
||||
-- Add semicolon or comma to the end of the line
|
||||
keymap("n", ";;", "A;<ESC>", opts)
|
||||
keymap("n", ",,", "A,<ESC>", opts)
|
||||
|
||||
-- Maintain the cursor position when yanking a visual selection
|
||||
keymap("v", "y", "myy`y", opts)
|
||||
|
||||
-- Delete last character of line
|
||||
keymap("n", "<leader>x", "$x", opts)
|
||||
|
||||
-- Open vim config in a new buffer, reload vim config
|
||||
keymap("n", "<leader>ve", "<cmd>e $MYVIMRC<CR>", opts)
|
||||
keymap("n", "<leader>vr", "<cmd>source $MYVIMRC<CR>", opts)
|
||||
|
||||
-- Delete current buffer
|
||||
keymap("n", "<leader>X", ":Bdelete<CR>", opts)
|
||||
|
||||
-- Delete all buffers
|
||||
keymap("n", "<leader>da", ":bufdo bdelete<CR>", opts)
|
||||
|
||||
-- Allow gf to open non-existent files
|
||||
keymap("", "gf", ":edit <cfile><CR>", opts)
|
||||
|
||||
-- Reselect visual selection after indenting
|
||||
keymap("v", "<", "<gv", opts)
|
||||
keymap("v", ">", ">gv", opts)
|
||||
|
||||
-- Set spell checker to `s`
|
||||
-- zg (good), zG (good temp), zw (wrong), zW (wrong temp)
|
||||
keymap("n", "<leader>rs", ":set spell!<CR>", opts)
|
||||
|
||||
-- Switch off highlighting
|
||||
keymap("n", "<leader>h", ":nohlsearch<CR>", opts)
|
||||
|
||||
-- Toggle list
|
||||
keymap("n", "<leader>l", ":set list!<CR>", opts)
|
||||
|
||||
-- Indent the whole source code
|
||||
keymap("n", "<leader>pf", "gg=G''", opts)
|
||||
|
||||
-- Reverse the mark mapping
|
||||
keymap("n", "'", "`", opts)
|
||||
keymap("n", "`", "'", opts)
|
||||
|
||||
-- Visuall select of just pasted content
|
||||
keymap("n", "gP", "`[v`]", opts)
|
||||
keymap("n", "gy", "`[v`]y", opts)
|
||||
|
||||
-- When text is wrapped, move by terminal rows, not lines, unless a count is provided
|
||||
keymap("n", "<expr> j", "(v:count == 0 ? 'gj' : 'j')", opts)
|
||||
keymap("n", "<expr> k", "(v:count == 0 ? 'gk' : 'k')", opts)
|
||||
|
||||
-- Open a quickfix window for the last search
|
||||
keymap("n", "<leader>?", ":execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>", opts)
|
||||
|
||||
-- Faster linewise scrolling
|
||||
keymap("n", "<C-e>", "3<C-e>", opts)
|
||||
keymap("n", "<C-y>", "3<C-y>", opts)
|
||||
|
||||
-- Keep the window centered
|
||||
keymap("n", "G", "Gzzzv", opts)
|
||||
keymap("n", "n", "nzzzv", opts)
|
||||
keymap("n", "N", "Nzzzv", opts)
|
||||
keymap("n", "}", "}zzzv", opts)
|
||||
keymap("n", "{", "{zzzv", opts)
|
||||
|
||||
-- Close all buffers
|
||||
keymap("n", "XX", ":qa<CR>", opts)
|
||||
|
||||
-- Add lines in NORMAL Mode
|
||||
keymap("n", "gN", "o<ESC>k", opts)
|
||||
keymap("n", "gNN", "O<ESC>j", opts)
|
||||
|
||||
-- Change to the folder of the current file
|
||||
keymap("n", "<leader>cf", ":cd %:p:h<CR>:pwd<CR>", opts)
|
||||
|
||||
-- Reformat a line into a block
|
||||
keymap("n", "<leader>rq", "gqip", opts)
|
||||
|
||||
-- Reformat a block into a line
|
||||
keymap("n", "<leader>rqq", "vipJ", opts)
|
||||
|
||||
-- Easier split navigation
|
||||
keymap("n", "<C-J>", "<C-W><C-K>", opts)
|
||||
keymap("n", "<C-K>", "<C-W><C-L>", opts)
|
||||
keymap("n", "<C-L>", "<C-W><C-H>", opts)
|
||||
keymap("n", "<C-H>", "<C-W><C-H>", opts)
|
||||
|
||||
-- Resize with arrows
|
||||
keymap("n", "<C-M-Up>", ":resize +2<CR>", opts)
|
||||
keymap("n", "<C-M-Down>", ":resize -2<CR>", opts)
|
||||
keymap("n", "<C-M-Left>", ":vertical resize +2<CR>", opts)
|
||||
keymap("n", "<C-M-Right>", ":vertical resize -2<CR>", opts)
|
||||
|
||||
-- Stay in indent mode
|
||||
keymap("v", "<", "<gv", opts)
|
||||
keymap("v", ">", ">gv", opts)
|
||||
|
||||
-- Move text up and down
|
||||
keymap("v", "<A-j>", ":m .+1<CR>==", opts)
|
||||
keymap("v", "<A-k>", ":m .-2<CR>==", opts)
|
||||
|
||||
-- Navigate buffers
|
||||
keymap("n", "<S-l>", ":bnext<CR>", opts)
|
||||
keymap("n", "<S-h>", ":bprevious<CR>", opts)
|
||||
|
||||
-- Remap Jump to Tag
|
||||
keymap("n", "ü", "<C-]>", opts)
|
||||
keymap("n", "Ü", "<C-O>", opts)
|
||||
|
||||
-- Open for Markdown in iA Writer
|
||||
keymap("n", "<leader>ia", ":silent !open -a iA\\ Writer.app '%:p'<CR>", opts)
|
||||
|
||||
-- Custom Text-Objects
|
||||
keymap("o", "il", ":<c-u>normal! $v^<CR>", opts)
|
||||
keymap("x", "il", ":<c-u>normal! $v^<CR>", opts)
|
||||
keymap("o", "al", ":<c-u>normal! $v0<CR>", opts)
|
||||
keymap("x", "al", ":<c-u>normal! $v0<CR>", opts)
|
||||
50
nvim/lua/kogakure/lsp/configs.lua
Normal file
50
nvim/lua/kogakure/lsp/configs.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = {
|
||||
"cssls",
|
||||
"cssmodules_ls",
|
||||
"diagnosticls",
|
||||
"emmet_ls",
|
||||
"graphql",
|
||||
"html",
|
||||
"jsonls",
|
||||
"pyright",
|
||||
"quick_lint_js",
|
||||
"sumneko_lua",
|
||||
"tsserver",
|
||||
}
|
||||
|
||||
lsp_installer.settings({
|
||||
ui = {
|
||||
icons = {
|
||||
server_installed = "✓",
|
||||
server_pending = "➜",
|
||||
server_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
|
||||
max_concurrent_installers = 4,
|
||||
})
|
||||
|
||||
lsp_installer.setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
for _, server in pairs(servers) do
|
||||
local opts = {
|
||||
on_attach = require("kogakure.lsp.handlers").on_attach,
|
||||
capabilities = require("kogakure.lsp.handlers").capabilities,
|
||||
}
|
||||
|
||||
local has_custom_opts, server_custom_opts = pcall(require, "kogakure.lsp.settings." .. server)
|
||||
if has_custom_opts then
|
||||
opts = vim.tbl_deep_extend("force", opts, server_custom_opts)
|
||||
end
|
||||
|
||||
lspconfig[server].setup(opts)
|
||||
end
|
||||
126
nvim/lua/kogakure/lsp/handlers.lua
Normal file
126
nvim/lua/kogakure/lsp/handlers.lua
Normal file
@@ -0,0 +1,126 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
local signs = {
|
||||
{ name = "DiagnosticSignError", text = "" },
|
||||
{ name = "DiagnosticSignWarn", text = "" },
|
||||
{ name = "DiagnosticSignHint", text = "" },
|
||||
{ name = "DiagnosticSignInfo", text = "" },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||
end
|
||||
|
||||
local config = {
|
||||
virtual_text = false, -- disable virtual text
|
||||
signs = {
|
||||
active = signs, -- show signs
|
||||
},
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config(config)
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = "rounded",
|
||||
})
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
border = "rounded",
|
||||
})
|
||||
end
|
||||
|
||||
local function lsp_highlight_document(client)
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
if client.resolved_capabilities.document_highlight then
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
augroup lsp_document_highlight
|
||||
autocmd! * <buffer>
|
||||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
augroup END
|
||||
]],
|
||||
false
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
local function lsp_keymaps(bufnr)
|
||||
local opts = { noremap = true, silent = true }
|
||||
local keymap = vim.api.nvim_buf_set_keymap
|
||||
|
||||
keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
keymap(bufnr, "n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
|
||||
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||
keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
keymap(bufnr, "n", "Ä", "<cmd>lua vim.diagnostic.goto_prev()<CR>", opts)
|
||||
keymap(bufnr, "n", "ä", "<cmd>lua vim.diagnostic.goto_next()<CR>", opts)
|
||||
end
|
||||
|
||||
-- TODO: Neovim 0.8 https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Avoiding-LSP-formatting-conflicts
|
||||
local lsp_formatting = function(bufnr)
|
||||
-- vim.lsp.buf.format({})
|
||||
vim.lsp.buf.formatting({
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
bufnr = bufnr,
|
||||
})
|
||||
end
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
-- Autosave
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
lsp_formatting(bufnr)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- TypeScript
|
||||
if client.name == "tsserver" then
|
||||
client.resolved_capabilities.document_formatting = false
|
||||
end
|
||||
|
||||
-- Lua
|
||||
if client.name == "sumneko_lua" then
|
||||
client.resolved_capabilities.document_formatting = false
|
||||
client.resolved_capabilities.document_range_formatting = false
|
||||
end
|
||||
|
||||
lsp_keymaps(bufnr)
|
||||
lsp_highlight_document(client)
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities)
|
||||
|
||||
return M
|
||||
10
nvim/lua/kogakure/lsp/init.lua
Normal file
10
nvim/lua/kogakure/lsp/init.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local status_ok, _ = pcall(require, 'lspconfig')
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require('kogakure.lsp.configs')
|
||||
require('kogakure.lsp.handlers').setup()
|
||||
require('kogakure.lsp.null-ls')
|
||||
require('kogakure.lsp.trouble')
|
||||
require('kogakure.lsp.lightbulb')
|
||||
11
nvim/lua/kogakure/lsp/lightbulb.lua
Normal file
11
nvim/lua/kogakure/lsp/lightbulb.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
-- nvim-lightbulb – https://github.com/kosayoda/nvim-lightbulb
|
||||
local status, lightbulb = pcall(require, "nvim-lightbulb")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
lightbulb.setup({
|
||||
autocmd = {
|
||||
enabled = true
|
||||
},
|
||||
})
|
||||
48
nvim/lua/kogakure/lsp/null-ls.lua
Normal file
48
nvim/lua/kogakure/lsp/null-ls.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
-- null-ls.nvim – https://github.com/jose-elias-alvarez/null-ls.nvim
|
||||
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/
|
||||
local formatting = null_ls.builtins.formatting
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
local completion = null_ls.builtins.completion
|
||||
local hover = null_ls.builtins.hover
|
||||
local code_actions = null_ls.builtins.code_actions
|
||||
|
||||
null_ls.setup({
|
||||
debug = false,
|
||||
sources = {
|
||||
code_actions.eslint_d,
|
||||
code_actions.gitrebase,
|
||||
code_actions.gitsigns,
|
||||
code_actions.proselint,
|
||||
completion.luasnip,
|
||||
completion.spell,
|
||||
-- diagnostics.codespell,
|
||||
diagnostics.eslint_d, -- Eslint
|
||||
diagnostics.flake8, -- Python
|
||||
diagnostics.gitlint,
|
||||
diagnostics.jsonlint,
|
||||
diagnostics.markdownlint,
|
||||
diagnostics.stylelint,
|
||||
diagnostics.tsc,
|
||||
-- diagnostics.write_good,
|
||||
diagnostics.yamllint,
|
||||
diagnostics.zsh,
|
||||
formatting.autopep8, -- Python
|
||||
formatting.black.with({ extra_args = { "--fast" } }), -- Python
|
||||
formatting.eslint_d,
|
||||
formatting.json_tool,
|
||||
formatting.markdownlint,
|
||||
formatting.prettier.with({ extra_args = { "--single-quote" } }),
|
||||
formatting.stylelint,
|
||||
formatting.stylua, -- Lua
|
||||
formatting.trim_newlines,
|
||||
formatting.trim_whitespace,
|
||||
hover.dictionary,
|
||||
},
|
||||
})
|
||||
211
nvim/lua/kogakure/lsp/settings/jsonls.lua
Normal file
211
nvim/lua/kogakure/lsp/settings/jsonls.lua
Normal file
@@ -0,0 +1,211 @@
|
||||
-- Find more schemas here: https://www.schemastore.org/json/
|
||||
local default_schemas = nil
|
||||
local status_ok, jsonls_settings = pcall(require, 'nlspsettings.jsonls')
|
||||
if status_ok then
|
||||
default_schemas = jsonls_settings.get_default_schemas()
|
||||
end
|
||||
|
||||
local schemas = {
|
||||
{
|
||||
description = 'TypeScript compiler configuration file',
|
||||
fileMatch = {
|
||||
'tsconfig.json',
|
||||
'tsconfig.*.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/tsconfig.json',
|
||||
},
|
||||
{
|
||||
description = 'Lerna config',
|
||||
fileMatch = {
|
||||
'lerna.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/lerna.json',
|
||||
},
|
||||
{
|
||||
description = 'Babel configuration',
|
||||
fileMatch = {
|
||||
'.babelrc.json',
|
||||
'.babelrc',
|
||||
'babel.config.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/babelrc.json',
|
||||
},
|
||||
{
|
||||
description = 'ESLint config',
|
||||
fileMatch = {
|
||||
'.eslintrc.json',
|
||||
'.eslintrc',
|
||||
},
|
||||
url = 'https://json.schemastore.org/eslintrc.json',
|
||||
},
|
||||
{
|
||||
description = 'Bucklescript config',
|
||||
fileMatch = {
|
||||
'bsconfig.json',
|
||||
},
|
||||
url = 'https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json',
|
||||
},
|
||||
{
|
||||
description = 'Prettier config',
|
||||
fileMatch = {
|
||||
'.prettierrc',
|
||||
'.prettierrc.json',
|
||||
'prettier.config.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/prettierrc',
|
||||
},
|
||||
{
|
||||
description = 'Vercel Now config',
|
||||
fileMatch = {
|
||||
'now.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/now',
|
||||
},
|
||||
{
|
||||
description = 'Stylelint config',
|
||||
fileMatch = {
|
||||
'.stylelintrc',
|
||||
'.stylelintrc.json',
|
||||
'stylelint.config.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/stylelintrc',
|
||||
},
|
||||
{
|
||||
description = 'A JSON schema for the ASP.NET LaunchSettings.json files',
|
||||
fileMatch = {
|
||||
'launchsettings.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/launchsettings.json',
|
||||
},
|
||||
{
|
||||
description = 'Schema for CMake Presets',
|
||||
fileMatch = {
|
||||
'CMakePresets.json',
|
||||
'CMakeUserPresets.json',
|
||||
},
|
||||
url = 'https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json',
|
||||
},
|
||||
{
|
||||
description = 'Configuration file as an alternative for configuring your repository in the settings page.',
|
||||
fileMatch = {
|
||||
'.codeclimate.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/codeclimate.json',
|
||||
},
|
||||
{
|
||||
description = 'LLVM compilation database',
|
||||
fileMatch = {
|
||||
'compile_commands.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/compile-commands.json',
|
||||
},
|
||||
{
|
||||
description = 'Config file for Command Task Runner',
|
||||
fileMatch = {
|
||||
'commands.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/commands.json',
|
||||
},
|
||||
{
|
||||
description = 'AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.',
|
||||
fileMatch = {
|
||||
'*.cf.json',
|
||||
'cloudformation.json',
|
||||
},
|
||||
url = 'https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json',
|
||||
},
|
||||
{
|
||||
description = 'The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.',
|
||||
fileMatch = {
|
||||
'serverless.template',
|
||||
'*.sam.json',
|
||||
'sam.json',
|
||||
},
|
||||
url = 'https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json',
|
||||
},
|
||||
{
|
||||
description = 'Json schema for properties json file for a GitHub Workflow template',
|
||||
fileMatch = {
|
||||
'.github/workflow-templates/**.properties.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/github-workflow-template-properties.json',
|
||||
},
|
||||
{
|
||||
description = 'golangci-lint configuration file',
|
||||
fileMatch = {
|
||||
'.golangci.toml',
|
||||
'.golangci.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/golangci-lint.json',
|
||||
},
|
||||
{
|
||||
description = 'JSON schema for the JSON Feed format',
|
||||
fileMatch = {
|
||||
'feed.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/feed.json',
|
||||
versions = {
|
||||
['1'] = 'https://json.schemastore.org/feed-1.json',
|
||||
['1.1'] = 'https://json.schemastore.org/feed.json',
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Packer template JSON configuration',
|
||||
fileMatch = {
|
||||
'packer.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/packer.json',
|
||||
},
|
||||
{
|
||||
description = 'NPM configuration file',
|
||||
fileMatch = {
|
||||
'package.json',
|
||||
},
|
||||
url = 'https://json.schemastore.org/package.json',
|
||||
},
|
||||
{
|
||||
description = 'JSON schema for Visual Studio component configuration files',
|
||||
fileMatch = {
|
||||
'*.vsconfig',
|
||||
},
|
||||
url = 'https://json.schemastore.org/vsconfig.json',
|
||||
},
|
||||
{
|
||||
description = 'Resume json',
|
||||
fileMatch = {
|
||||
'resume.json',
|
||||
},
|
||||
url = 'https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json',
|
||||
},
|
||||
}
|
||||
|
||||
local function extend(tab1, tab2)
|
||||
if tab2 == nil then
|
||||
return tab2
|
||||
end
|
||||
for _, value in ipairs(tab2) do
|
||||
table.insert(tab1, value)
|
||||
end
|
||||
return tab1
|
||||
end
|
||||
|
||||
local extended_schemas = extend(schemas, default_schemas)
|
||||
|
||||
local opts = {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = extended_schemas,
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
commands = {
|
||||
Format = {
|
||||
function()
|
||||
vim.lsp.buf.range_formatting({}, { 0, 0, }, { vim.fn.line '$', 0 })
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return opts
|
||||
9
nvim/lua/kogakure/lsp/settings/pyright.lua
Normal file
9
nvim/lua/kogakure/lsp/settings/pyright.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
typeCheckingMode = 'off',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
15
nvim/lua/kogakure/lsp/settings/sumneko_lua.lua
Normal file
15
nvim/lua/kogakure/lsp/settings/sumneko_lua.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim", "hs", "window" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
8
nvim/lua/kogakure/lsp/trouble.lua
Normal file
8
nvim/lua/kogakure/lsp/trouble.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
-- Trouble – https://github.com/folke/trouble.nvim
|
||||
local status, trouble = pcall(require, 'trouble')
|
||||
if (not status) then
|
||||
return
|
||||
end
|
||||
|
||||
trouble.setup()
|
||||
|
||||
35
nvim/lua/kogakure/lualine.lua
Normal file
35
nvim/lua/kogakure/lualine.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
-- lualine.nvim – https://github.com/nvim-lualine/lualine.nvim
|
||||
local status, lualine = pcall(require, "lualine")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "onedark",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline " },
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
7
nvim/lua/kogakure/neoscroll.lua
Normal file
7
nvim/lua/kogakure/neoscroll.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
-- Neoscroll – https://github.com/karb94/neoscroll.nvim
|
||||
local status, neoscroll = pcall(require, 'neoscroll')
|
||||
if (not status) then
|
||||
return
|
||||
end
|
||||
|
||||
neoscroll.setup()
|
||||
7
nvim/lua/kogakure/nvim-tree.lua
Normal file
7
nvim/lua/kogakure/nvim-tree.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
-- nvim-tree.lua – https://github.com/kyazdani42/nvim-tree.lua
|
||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
nvim_tree.setup()
|
||||
84
nvim/lua/kogakure/options.lua
Normal file
84
nvim/lua/kogakure/options.lua
Normal file
@@ -0,0 +1,84 @@
|
||||
-- :help options
|
||||
local options = {
|
||||
autowrite = true,
|
||||
backspace = { "indent", "eol", "start" }, -- Intuitive backspacing
|
||||
backup = false,
|
||||
clipboard = "unnamedplus",
|
||||
completeopt = { "menu", "menuone", "preview" },
|
||||
confirm = true,
|
||||
copyindent = true,
|
||||
cursorline = true,
|
||||
expandtab = true,
|
||||
foldlevel = 2,
|
||||
foldlevelstart = 99,
|
||||
foldmethod = "syntax",
|
||||
foldnestmax = 10,
|
||||
grepformat = "%f:%l:%c:%m",
|
||||
grepprg = "rg\\ --vimgrep\\ --no-heading\\ --smart-case",
|
||||
hidden = true,
|
||||
ignorecase = true,
|
||||
list = true,
|
||||
listchars = {
|
||||
tab = "∙\\ ",
|
||||
trail = "·",
|
||||
nbsp = ".",
|
||||
extends = "❯",
|
||||
precedes = "❮",
|
||||
},
|
||||
mouse = "a",
|
||||
number = true,
|
||||
omnifunc = "syntaxcomplete#Complete",
|
||||
redrawtime = 10000, -- Allow more time for loading syntax on large files
|
||||
relativenumber = true,
|
||||
scrolloff = 8,
|
||||
shiftround = true,
|
||||
shiftwidth = 2,
|
||||
shortmess = "caoOtI", -- Welcome screen
|
||||
showbreak = "↪",
|
||||
sidescrolloff = 8,
|
||||
signcolumn = "yes:2",
|
||||
smartcase = true,
|
||||
softtabstop = 2,
|
||||
spelllang = "en_us",
|
||||
splitbelow = true,
|
||||
splitright = true,
|
||||
swapfile = false,
|
||||
tabstop = 2,
|
||||
termguicolors = true,
|
||||
timeoutlen = 300,
|
||||
title = true,
|
||||
undofile = true,
|
||||
virtualedit = "all",
|
||||
visualbell = true,
|
||||
wildmode = { "longest:full", "full" },
|
||||
wrap = false,
|
||||
writebackup = false,
|
||||
}
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
-- Add dashes to words
|
||||
vim.opt.iskeyword:append("-")
|
||||
|
||||
-- Don"t delete the word, but put a $ to the end till exit the mode
|
||||
vim.opt.cpoptions:append("$")
|
||||
|
||||
vim.opt.path:append("**")
|
||||
vim.opt.complete:append({ "i", "k", "s", "kspell" })
|
||||
|
||||
-- FIXME: When using "vim.opt.spellfile:append("~/.config/…) the file is not writable"
|
||||
vim.cmd([[
|
||||
" Spell Checker
|
||||
set spellfile+=~/.config/nvim/spell/en.utf-8.add
|
||||
|
||||
" Custom Dictionaries (<C-x> <C-k>)
|
||||
set dictionary+=~/.config/nvim/dictionary/de_user.txt
|
||||
set dictionary+=~/.config/nvim/dictionary/de_neu.txt
|
||||
set dictionary+=~/.config/nvim/dictionary/en_us.txt
|
||||
|
||||
" Custom Thesauri (Synonyms) (<C-x> <C-t>)
|
||||
set thesaurus+=~/.config/nvim/thesaurus/de_user.txt
|
||||
set thesaurus+=~/.config/nvim/thesaurus/de_openthesaurus.txt
|
||||
]])
|
||||
168
nvim/lua/kogakure/plugins.lua
Normal file
168
nvim/lua/kogakure/plugins.lua
Normal file
@@ -0,0 +1,168 @@
|
||||
-- Packer.nvim – https://github.com/wbthomason/packer.nvim
|
||||
local fn = vim.fn
|
||||
|
||||
-- Automatically install packer
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
PACKER_BOOTSTRAP = fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
})
|
||||
print("Installing packer close and reopen Neovim...")
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
end
|
||||
|
||||
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]])
|
||||
|
||||
-- Use a protected call so we don’t error out on first use
|
||||
local status_ok, packer = pcall(require, "packer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- Have packer use a popup window
|
||||
packer.init({
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float({
|
||||
border = "rounded",
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Plugins
|
||||
return packer.startup(function(use)
|
||||
use("wbthomason/packer.nvim") -- Have packer manage itself
|
||||
use("nvim-lua/popup.nvim") -- An implementation of the Popup API from vim in Neovim
|
||||
use("nvim-lua/plenary.nvim") -- Useful lua functions used ny lots of plugins
|
||||
|
||||
-- Colorscheme
|
||||
use("chriskempson/base16-vim") -- Base16 colorschemes
|
||||
|
||||
-- CMP
|
||||
use("hrsh7th/nvim-cmp") -- The completion plugin
|
||||
use("hrsh7th/cmp-buffer") -- Buffer completions
|
||||
use("hrsh7th/cmp-path") -- Path completions
|
||||
use("hrsh7th/cmp-cmdline") -- Cmdline completions
|
||||
use("hrsh7th/cmp-nvim-lua") -- Lua API completions
|
||||
use("saadparwaiz1/cmp_luasnip") -- Snippet completions
|
||||
use("uga-rosa/cmp-dictionary") -- Dictionary completions
|
||||
use("f3fora/cmp-spell") -- Spell completions
|
||||
use("David-Kunz/cmp-npm") -- NPM package completions
|
||||
use("hrsh7th/cmp-nvim-lsp") -- LSP completions
|
||||
use("hrsh7th/cmp-nvim-lsp-signature-help") -- LSP Signature Help
|
||||
|
||||
-- Snippets
|
||||
use("L3MON4D3/LuaSnip") -- Snippet Engine
|
||||
use("rafamadriz/friendly-snippets") -- A bunch of snippets
|
||||
|
||||
-- LSP
|
||||
use("neovim/nvim-lspconfig") -- Enable LSP
|
||||
use("williamboman/nvim-lsp-installer") -- Simple to use language server installer
|
||||
use("jose-elias-alvarez/null-ls.nvim") -- Inject LSP diagnostics, code actions, and more
|
||||
use("folke/trouble.nvim") -- Diagnostics
|
||||
use("creativenull/diagnosticls-configs-nvim") -- Collection of linters and formatters
|
||||
use("tamago324/nlsp-settings.nvim") -- LSP for json/yaml
|
||||
use({ "kosayoda/nvim-lightbulb", requires = "antoinemadec/FixCursorHold.nvim" })
|
||||
|
||||
-- FZF
|
||||
use({ "junegunn/fzf", run = "./install --bin" })
|
||||
use("ibhagwan/fzf-lua")
|
||||
|
||||
-- Telescope
|
||||
use("nvim-telescope/telescope.nvim")
|
||||
use("dhruvmanila/telescope-bookmarks.nvim") -- Open browser bookmarks
|
||||
use("nvim-telescope/telescope-file-browser.nvim") -- File and folder actions
|
||||
use("sudormrfbin/cheatsheet.nvim") -- Searchable cheatsheet
|
||||
use("nvim-telescope/telescope-node-modules.nvim") -- node_modules packages
|
||||
use("gbrlsnchs/telescope-lsp-handlers.nvim") -- LSP handlers
|
||||
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
|
||||
use({ "nvim-telescope/telescope-frecency.nvim", requires = { "tami5/sqlite.lua" } }) -- Frequency and recency
|
||||
|
||||
-- Treesitter
|
||||
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
|
||||
use("p00f/nvim-ts-rainbow") -- Rainbox parentheses
|
||||
use("nvim-treesitter/playground") -- Treesitter information in Neovim
|
||||
|
||||
-- File/Window Management
|
||||
use("ThePrimeagen/harpoon") -- Getting you where you want
|
||||
use("lewis6991/gitsigns.nvim") -- Git decorations
|
||||
use("kyazdani42/nvim-web-devicons") -- Icons and colors for file types
|
||||
use("kyazdani42/nvim-tree.lua") -- A File Explorer
|
||||
use("akinsho/bufferline.nvim") -- Emulate tabs for buffers
|
||||
use("moll/vim-bbye") -- Delete buffers without closing the window
|
||||
use("akinsho/toggleterm.nvim") -- Terminal in Neovim
|
||||
use("nvim-lualine/lualine.nvim") -- Statusline
|
||||
use("norcalli/nvim-colorizer.lua") -- Highlight colors
|
||||
use("ahmedkhalf/project.nvim") -- Project Management
|
||||
use("lewis6991/impatient.nvim") -- Speed Up Startup
|
||||
use("lukas-reineke/indent-blankline.nvim") -- Indentation guides
|
||||
use("goolord/alpha-nvim") -- Customizable Greeter
|
||||
use("antoinemadec/FixCursorHold.nvim") -- This is needed to fix lsp doc highlight
|
||||
use("MattesGroeger/vim-bookmarks") -- Bookmarks
|
||||
use("folke/which-key.nvim") -- Display possible keybindings
|
||||
use("karb94/neoscroll.nvim") -- Smooth scrolling
|
||||
use("APZelos/blamer.nvim") -- Git Blame
|
||||
use("elijahmanor/export-to-vscode.nvim") -- Export active Buffers to Visual Studio Code
|
||||
use("bogado/file-line") -- Jump directly to line in file with 'nvim index.html:20'
|
||||
use("ruanyl/vim-gh-line") -- Open current line in GitHub
|
||||
use("nvim-pack/nvim-spectre") -- Search and replace
|
||||
use("junegunn/goyo.vim") -- Zen Mode (1)
|
||||
use("folke/zen-mode.nvim") -- Zen Mode (2)
|
||||
use("tpope/vim-eunuch") -- UNIX Shell commands
|
||||
use("folke/twilight.nvim") -- Dim inactive code
|
||||
|
||||
-- Editing Files
|
||||
use("windwp/nvim-autopairs") -- Autopairs, integrates with both cmp and treesitter
|
||||
use("numToStr/Comment.nvim") -- Easily comment stuff
|
||||
use("JoosepAlviste/nvim-ts-context-commentstring") -- Comment based on cursor location of file
|
||||
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install", cmd = "MarkdownPreview" })
|
||||
use("yamatsum/nvim-cursorline") -- Highlight words and lines on the cursor
|
||||
use("mattn/emmet-vim") -- Emmet
|
||||
use("editorconfig/editorconfig-vim") -- Editorconfig
|
||||
use("sheerun/vim-polyglot") -- A collection of language packs (?)
|
||||
use("godlygeek/tabular") -- Align everything
|
||||
use("tpope/vim-abolish") -- Autofix spelling mistakes
|
||||
use("mg979/vim-visual-multi") -- Multi cursor mode
|
||||
use("vim-scripts/VisIncr") -- Increase and decreasing numbers, dates, daynames etc.
|
||||
use("tpope/vim-speeddating") -- Increase dates, times, etc.
|
||||
use("rstacruz/vim-xtract") -- Extract code into new file
|
||||
use("tpope/vim-repeat") -- Repeat plugins
|
||||
use("tpope/vim-surround") -- Replace, add, remove surroundings
|
||||
|
||||
-- Custom Text Objects
|
||||
use("christoomey/vim-titlecase")
|
||||
use("glts/vim-textobj-comment") -- ac, ic, aC
|
||||
use("jceb/vim-textobj-uri") -- au, iu, go
|
||||
use("kana/vim-textobj-datetime") -- ada, add, adf, adt, adz, ida, …
|
||||
use("kana/vim-textobj-user")
|
||||
use("michaeljsmith/vim-indent-object") -- ai, ii, aI, iI
|
||||
use("whatyouhide/vim-textobj-xmlattr") -- ax, ix
|
||||
|
||||
-- Custom Motions
|
||||
use("christoomey/vim-sort-motion") -- gs
|
||||
use("tommcdo/vim-exchange") -- cx, cxx, X, cxc
|
||||
use("easymotion/vim-easymotion") -- <Leader>f/L
|
||||
|
||||
-- TMUX
|
||||
use("christoomey/vim-tmux-navigator")
|
||||
use("preservim/vimux")
|
||||
use("tyewang/vimux-jest-test")
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if PACKER_BOOTSTRAP then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
32
nvim/lua/kogakure/project.lua
Normal file
32
nvim/lua/kogakure/project.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
-- project.nvim – https://github.com/ahmedkhalf/project.nvim
|
||||
local status_ok, project = pcall(require, "project_nvim")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
project.setup({
|
||||
active = true,
|
||||
on_config_done = nil,
|
||||
manual_mode = false,
|
||||
detection_methods = {
|
||||
"pattern",
|
||||
},
|
||||
patterns = {
|
||||
".git",
|
||||
"_darcs",
|
||||
".hg",
|
||||
".bzr",
|
||||
".svn",
|
||||
"Makefile",
|
||||
-- 'package.json',
|
||||
},
|
||||
show_hidden = false,
|
||||
silent_chdir = true,
|
||||
ignore_lsp = {},
|
||||
datapath = vim.fn.stdpath("data"),
|
||||
})
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
keymap("n", "<leader>pm", [[<Cmd>:Telescope projects<CR>]], opts)
|
||||
7
nvim/lua/kogakure/spectre.lua
Normal file
7
nvim/lua/kogakure/spectre.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
-- nvim-spectre – https://github.com/nvim-pack/nvim-spectre
|
||||
local status_ok, spectre = pcall(require, "spectre")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
spectre.setup()
|
||||
4
nvim/lua/kogakure/speeddating.lua
Normal file
4
nvim/lua/kogakure/speeddating.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
-- speeddating.vim – https://github.com/tpope/vim-speeddating
|
||||
vim.cmd([[
|
||||
autocmd VimEnter * SpeedDatingFormat %d.%m.%Y
|
||||
]])
|
||||
170
nvim/lua/kogakure/telescope.lua
Normal file
170
nvim/lua/kogakure/telescope.lua
Normal file
@@ -0,0 +1,170 @@
|
||||
-- telescope.nvim – https://github.com/nvim-telescope/telescope.nvim/
|
||||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
-- Extensions
|
||||
telescope.load_extension("bookmarks")
|
||||
telescope.load_extension("node_modules")
|
||||
telescope.load_extension("file_browser")
|
||||
telescope.load_extension("frecency")
|
||||
telescope.load_extension("lsp_handlers")
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("harpoon")
|
||||
telescope.load_extension("projects")
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>bm", [[<Cmd>Telescope bookmarks<CR>]], opts)
|
||||
keymap("n", "<leader>gb", [[<Cmd>Telescope git_branches<CR>]], opts)
|
||||
keymap("n", "<leader>gs", [[<Cmd>Telescope git_status<CR>]], opts)
|
||||
keymap("n", "<leader>ht", [[<Cmd>Telescope help_tags<CR>]], opts)
|
||||
keymap("n", "<leader>km", [[<Cmd>Telescope keymaps<CR>]], opts)
|
||||
keymap("n", "<leader>m", [[<Cmd>Telescope marks<CR>]], opts)
|
||||
keymap("n", "<leader>mru", [[<Cmd>Telescope frecency<CR>]], opts)
|
||||
keymap("n", "<leader>nm", [[<Cmd>Telescope node_modules list<CR>]], opts)
|
||||
keymap("n", "<leader>tb", [[<Cmd>Telescope buffers<CR>]], opts)
|
||||
keymap("n", "<leader>C", [[<Cmd>:Cheatsheet<CR>]], opts)
|
||||
keymap("n", "<leader>tf", [[<Cmd>Telescope find_files<CR>]], opts)
|
||||
keymap("n", "<leader>tfa", [[<Cmd>Telescope find_files hidden=true<CR>]], opts)
|
||||
keymap("n", "<leader>tfb", [[<Cmd>Telescope file_browser<CR>]], opts)
|
||||
keymap("n", "<leader>tg", [[<Cmd>Telescope tags<CR>]], opts)
|
||||
keymap("n", "<leader>tlg", [[<Cmd>Telescope live_grep<CR>]], opts)
|
||||
keymap("n", "<leader>tr", [[<Cmd>Telescope resume<CR>]], opts)
|
||||
|
||||
-- Setup
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
path_display = {
|
||||
"smart",
|
||||
},
|
||||
file_ignore_pattern = {
|
||||
"yarn.lock",
|
||||
},
|
||||
mappings = {
|
||||
-- INSERT Mode
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
-- NORMAL Mode
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
theme = "dropdown",
|
||||
previewer = false,
|
||||
show_all_buffers = true,
|
||||
sort_lastused = true,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
file_browser = {
|
||||
theme = "ivy",
|
||||
hijack_netrw = true,
|
||||
},
|
||||
frecency = {
|
||||
show_scores = false,
|
||||
show_unindexed = true,
|
||||
ignore_patterns = {
|
||||
"*.git/*",
|
||||
"*/tmp/*",
|
||||
},
|
||||
disable_devicons = false,
|
||||
},
|
||||
bookmarks = {
|
||||
selected_browser = "brave",
|
||||
url_open_command = "open",
|
||||
},
|
||||
lsp_handlers = {
|
||||
disable = {},
|
||||
location = {
|
||||
telescope = {},
|
||||
no_results_message = "No references found",
|
||||
},
|
||||
symbol = {
|
||||
telescope = {},
|
||||
no_results_message = "No symbols found",
|
||||
},
|
||||
call_hierarchy = {
|
||||
telescope = {},
|
||||
no_results_message = "No calls found",
|
||||
},
|
||||
code_action = {
|
||||
telescope = require("telescope.themes").get_dropdown({}),
|
||||
no_results_message = "No code actions available",
|
||||
prefix = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
80
nvim/lua/kogakure/text-objects.lua
Normal file
80
nvim/lua/kogakure/text-objects.lua
Normal file
@@ -0,0 +1,80 @@
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
-- Basic Text Objects
|
||||
function Basic_text_objects()
|
||||
local chars = { "_", ".", ":", ",", ";", "|", "/", "\\", "*", "+", "%", "`", "?" }
|
||||
for _, char in ipairs(chars) do
|
||||
for _, mode in ipairs({ "x", "o" }) do
|
||||
keymap(mode, "i" .. char, string.format(":<C-u>normal! T%svt%s<CR>", char, char), {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
})
|
||||
keymap(mode, "a" .. char, string.format(":<C-u>normal! F%svf%s<CR>", char, char), {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Select_indent(around)
|
||||
local start_indent = vim.fn.indent(vim.fn.line("."))
|
||||
local blank_line_pattern = "^%s*$"
|
||||
|
||||
if string.match(vim.fn.getline("."), blank_line_pattern) then
|
||||
return
|
||||
end
|
||||
|
||||
if vim.v.count > 0 then
|
||||
start_indent = start_indent - vim.o.shiftwidth * (vim.v.count - 1)
|
||||
if start_indent < 0 then
|
||||
start_indent = 0
|
||||
end
|
||||
end
|
||||
|
||||
local prev_line = vim.fn.line(".") - 1
|
||||
local prev_blank_line = function(line)
|
||||
return string.match(vim.fn.getline(line), blank_line_pattern)
|
||||
end
|
||||
while prev_line > 0 and (prev_blank_line(prev_line) or vim.fn.indent(prev_line) >= start_indent) do
|
||||
vim.cmd("-")
|
||||
prev_line = vim.fn.line(".") - 1
|
||||
end
|
||||
if around then
|
||||
vim.cmd("-")
|
||||
end
|
||||
|
||||
vim.cmd("normal! 0V")
|
||||
|
||||
local next_line = vim.fn.line(".") + 1
|
||||
local next_blank_line = function(line)
|
||||
return string.match(vim.fn.getline(line), blank_line_pattern)
|
||||
end
|
||||
local last_line = vim.fn.line("$")
|
||||
while next_line <= last_line and (next_blank_line(next_line) or vim.fn.indent(next_line) >= start_indent) do
|
||||
vim.cmd("+")
|
||||
next_line = vim.fn.line(".") + 1
|
||||
end
|
||||
if around then
|
||||
vim.cmd("+")
|
||||
end
|
||||
end
|
||||
|
||||
-- Indent Text Object
|
||||
function Indent_text_objects()
|
||||
for _, mode in ipairs({ "x", "o" }) do
|
||||
keymap(mode, "ii", ":<c-u>lua select_indent()<cr>", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
})
|
||||
keymap(mode, "ai", ":<c-u>lua select_indent(true)<cr>", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
basic_text_objects = Basic_text_objects,
|
||||
indent_text_objects = Indent_text_objects,
|
||||
}
|
||||
98
nvim/lua/kogakure/toggleterm.lua
Normal file
98
nvim/lua/kogakure/toggleterm.lua
Normal file
@@ -0,0 +1,98 @@
|
||||
local status_ok, toggleterm = pcall(require, "toggleterm")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
toggleterm.setup({
|
||||
size = 20,
|
||||
open_mapping = [[<C-t>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persist_size = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = {
|
||||
noremap = true,
|
||||
}
|
||||
local keymap = vim.api.nvim_buf_set_keymap
|
||||
|
||||
keymap(0, "t", "<esc>", [[<C-\><C-n>]], opts)
|
||||
keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
|
||||
keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
|
||||
keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
|
||||
keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
local node = Terminal:new({
|
||||
cmd = "node",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
local ncdu = Terminal:new({
|
||||
cmd = "ncdu",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _NCDU_TOGGLE()
|
||||
ncdu:toggle()
|
||||
end
|
||||
|
||||
local htop = Terminal:new({
|
||||
cmd = "htop",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _HTOP_TOGGLE()
|
||||
htop:toggle()
|
||||
end
|
||||
|
||||
local python = Terminal:new({
|
||||
cmd = "python",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true, }
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>lg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>node", "<cmd>lua _NODE_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>py", "<cmd>lua _PYTHON_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>top", "<cmd>lua _HTOP_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>ncdu", "<cmd>lua _NCDU_TOGGLE()<CR>", opts)
|
||||
32
nvim/lua/kogakure/treesitter.lua
Normal file
32
nvim/lua/kogakure/treesitter.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
-- nvim-treesitter – https://github.com/nvim-treesitter/nvim-treesitter/
|
||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup {
|
||||
ensure_installed = "all",
|
||||
sync_install = false,
|
||||
ignore_install = { "" }, -- List of parsers to ignore installing
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "" }, -- list of language that will be disabled
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "yaml" } },
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
||||
12
nvim/lua/kogakure/vim-easymotion.lua
Normal file
12
nvim/lua/kogakure/vim-easymotion.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
-- vim-easymotion – https://github.com/easymotion/vim-easymotion
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Keymaps
|
||||
-- <Leader>f{char} to move to {char}
|
||||
keymap("", "<leader>l", [[<Plug>(easymotion-bd-f)]], opts)
|
||||
keymap("n", "<leader>l", [[<Plug>(easymotion-overwin-f)]], opts)
|
||||
|
||||
-- Move to line
|
||||
keymap("", "<leader>L", [[<Plug>(easymotion-bd-jk)]], opts)
|
||||
keymap("n", "<leader>L", [[<Plug>(easymotion-overwin-line)]], opts)
|
||||
3
nvim/lua/kogakure/vim-gh-line.lua
Normal file
3
nvim/lua/kogakure/vim-gh-line.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
-- vim-gh-line – https://github.com/ruanyl/vim-gh-line
|
||||
|
||||
vim.g.gh_github_domain = "source.xing.cm"
|
||||
15
nvim/lua/kogakure/vimux.lua
Normal file
15
nvim/lua/kogakure/vimux.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Vimux – https://github.com/preservim/vimux
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.g.VimuxHeight = "30"
|
||||
vim.g.VimuxOrientation = "h"
|
||||
vim.g.VimuxUseNearestPane = 0
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>vt", [[<cmd>VimuxTogglePane<CR>]], opts)
|
||||
keymap("n", "<leader>vp", [[<cmd>VimuxPromptCommand<CR>]], opts)
|
||||
keymap("n", "<leader>vl", [[<cmd>VimuxRunLastCommand<CR>]], opts)
|
||||
keymap("n", "<leader>vj", [[<cmd>RunJest<CR>]], opts)
|
||||
keymap("n", "<leader>vjb", [[<cmd>RunJestOnBuffer<CR>]], opts)
|
||||
keymap("n", "<leader>vjf", [[<cmd>RunJestFocused<CR>]], opts)
|
||||
257
nvim/lua/kogakure/whichkey.lua
Normal file
257
nvim/lua/kogakure/whichkey.lua
Normal file
@@ -0,0 +1,257 @@
|
||||
local status_ok, which_key = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local mappings = {
|
||||
a = { "<CMD>Alpha<CR>", "Alpha" },
|
||||
b = {
|
||||
"<CMD>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})<CR>",
|
||||
"Buffers",
|
||||
},
|
||||
c = { "<CMD>lua require('Comment.api').toggle_current_linewise()<CR>", "Comment" },
|
||||
d = { "<CMD>TroubleToggle<CR>", "Diagnostics" },
|
||||
e = { "<CMD>NvimTreeToggle<CR>", "Explorer" },
|
||||
f = { "<CMD>FzfLua files<CR>", "Find Files" },
|
||||
h = { "<CMD>nohlsearch<CR>", "No Highlight" },
|
||||
j = { "<CMD>b#<CR>", "Toggle Buffers" },
|
||||
i = { "<CMD>silent !open -a iA\\ Writer.app '%:p'<CR>", "Open in iA Writer" },
|
||||
p = {
|
||||
name = "Packer",
|
||||
c = { "<CMD>PackerCompile<CR>", "Compile" },
|
||||
i = { "<CMD>PackerInstall<CR>", "Install" },
|
||||
s = { "<CMD>PackerSync<CR>", "Sync" },
|
||||
S = { "<CMD>PackerStatus<CR>", "Status" },
|
||||
u = { "<CMD>PackerUpdate<CR>", "Update" },
|
||||
},
|
||||
q = { "<CMD>Bdelete!<CR>", "Close Buffer" },
|
||||
s = {
|
||||
a = { "<Cmd>:FzfLua lsp_code_actions<CR>", "LSP Code Actions" },
|
||||
d = { "<Cmd>:FzfLua lsp_definitions<CR>", "LSP Definitions" },
|
||||
s = { "<Cmd>:FzfLua lsp_document_symbols<CR>", "LSP Document Symbols" },
|
||||
w = { "<Cmd>:FzfLua lsp_live_workspace_symbols<CR>", "LSP Live Workspace Symbols" },
|
||||
r = { "<Cmd>:FzfLua lsp_references<CR>", "LSP References" },
|
||||
t = { "<Cmd>:FzfLua lsp_typedef<CR>", "LSP Type Definition" },
|
||||
name = "Search",
|
||||
F = {
|
||||
name = "FZF",
|
||||
b = { "<Cmd>:FzfLua blines<CR>", "Bufferlines" },
|
||||
f = { "<Cmd>:FzfLua files<CR>", "Files" },
|
||||
h = { "<Cmd>:FzfLua oldfiles<CR>", "Open Files History" },
|
||||
i = { "<Cmd>:FzfLua spell_suggest<CR>", "Spelling Suggestions" },
|
||||
m = { "<Cmd>:FzfLua marks<CR>", "Marks" },
|
||||
o = { "<Cmd>:FzfLua lines<CR>", "Open Buffer Lines" },
|
||||
q = { "<Cmd>:FzfLua quickfix<CR>", "Quickfix" },
|
||||
r = { "<Cmd>:FzfLua resume<CR>", "Resume last command" },
|
||||
t = { "<Cmd>:FzfLua tabs<CR>", "Tabs" },
|
||||
g = {
|
||||
name = "Git",
|
||||
b = { "<Cmd>:FzfLua git_branches<CR>", "Git Branches" },
|
||||
c = { "<Cmd>:FzfLua git_commits<CR>", "Git Commits" },
|
||||
s = { "<Cmd>:FzfLua git_stash<CR>", "Git Stashes" },
|
||||
t = { "<Cmd>:FzfLua git_status<CR>", "Git Status" },
|
||||
},
|
||||
s = {
|
||||
name = "Search",
|
||||
s = { "<Cmd>:FzfLua grep<CR>", "Grep Search" },
|
||||
i = { "<Cmd>:FzfLua live_grep<CR>", "Live Grep" },
|
||||
l = { "<Cmd>:FzfLua grep_last<CR>", "Last Grep Search" },
|
||||
r = { "<Cmd>:FzfLua live_grep_resume<CR>", "Resume Last Search" },
|
||||
c = { "<Cmd>:FzfLua grep_cword<CR>", "Search Word Under Cursor" },
|
||||
v = { "<Cmd>:FzfLua grep_visual<CR>", "Search Visual Selection" },
|
||||
p = { "<Cmd>:FzfLua grep_project<CR>", "Grep Search in Project" },
|
||||
},
|
||||
},
|
||||
T = {
|
||||
name = "Telescope",
|
||||
u = { "<Cmd>Telescope frecency<CR>", "MRU (Frequency)" },
|
||||
r = { "<Cmd>Telescope resume<CR>", "Resume last search" },
|
||||
b = { "<Cmd>Telescope bookmarks<CR>", "Browser Bookmarks" },
|
||||
m = { "<Cmd>Telescope marks<CR>", "Marks" },
|
||||
n = { "<Cmd>Telescope node_modules list<CR>", "Node Modules" },
|
||||
k = { "<Cmd>Telescope keymaps<CR>", "Keymaps" },
|
||||
h = { "<Cmd>Telescope help_tags<CR>", "Help Tags" },
|
||||
t = { "<Cmd>Telescope tags<CR>", "Tags" },
|
||||
f = {
|
||||
name = "Find",
|
||||
s = { "<Cmd>Telescope find_files<CR>", "Find Files" },
|
||||
a = { "<Cmd>Telescope find_files hidden=true<CR>", "Find all files" },
|
||||
f = { "<Cmd>Telescope file_browser<CR>", "File Browser" },
|
||||
l = { "<Cmd>Telescope live_grep<CR>", "Live Grep" },
|
||||
},
|
||||
g = {
|
||||
name = "Git",
|
||||
b = { "<Cmd>Telescope git_branches<CR>", "Git Branches" },
|
||||
s = { "<Cmd>Telescope git_status<CR>", "Git Status" },
|
||||
},
|
||||
},
|
||||
S = {
|
||||
name = "Spectre",
|
||||
f = { "<CMD>lua require('spectre').open_file_search()<CR>", "File Search" },
|
||||
c = { "<CMD>lua require('spectre').open_visual({select_word=true})<CR>", "Search Current Word" },
|
||||
},
|
||||
},
|
||||
t = {
|
||||
name = "Terminal",
|
||||
f = { "<CMD>ToggleTerm direction=float<CR>", "Float" },
|
||||
h = { "<CMD>ToggleTerm size=10 direction=horizontal<CR>", "Horizontal" },
|
||||
l = { "<CMD>lua _LAZYGIT_TOGGLE()<CR>", "LazyGit" },
|
||||
n = { "<CMD>lua _NODE_TOGGLE()<CR>", "Node" },
|
||||
p = { "<CMD>lua _PYTHON_TOGGLE()<CR>", "Python" },
|
||||
t = { "<CMD>lua _HTOP_TOGGLE()<CR>", "Htop" },
|
||||
u = { "<CMD>lua _NCDU_TOGGLE()<CR>", "NCDU" },
|
||||
v = { "<CMD>ToggleTerm size=80 direction=vertical<CR>", "Vertical" },
|
||||
},
|
||||
v = { "<CMD>lua require('export-to-vscode').launch()<CR>", "Export to Visual Studio Code" },
|
||||
w = { "<CMD>w!<CR>", "Save" },
|
||||
z = {
|
||||
name = "Zen",
|
||||
g = { "<CMD>Goyo<CR>", "Goyo" },
|
||||
z = { "<CMD>ZenMode<CR>", "ZenMode" },
|
||||
t = { "<CMD>Twilight<CR>", "Twilight Mode" },
|
||||
},
|
||||
B = {
|
||||
name = "Bufferline",
|
||||
p = { "<CMD>BufferLinePick<CR>", "Pick" },
|
||||
x = { "<CMD>BufferLinePickClose<CR>", "Pick to Close" },
|
||||
},
|
||||
E = {
|
||||
name = "Explorer",
|
||||
a = { "<CMD>NvimTreeFocus<CR>", "Focus" },
|
||||
c = { "<CMD>NvimTreeCollapse<CR>", "Collapse Folders" },
|
||||
f = { "<CMD>NvimTreeFindFile<CR>", "Find File" },
|
||||
r = { "<CMD>NvimTreeRefresh<CR>", "Refresh" },
|
||||
},
|
||||
F = { "<CMD>FzfLua live_grep<CR>", "Find Text" },
|
||||
G = {
|
||||
name = "Git & GitHub",
|
||||
b = { "<CMD>BlamerToggle<CR>", "Blame Line" },
|
||||
g = { "<CMD>GBInteractive<CR>", "Git Blame in GitHub" },
|
||||
h = { "<CMD>GHInteractive<CR>", "Open in GitHub" },
|
||||
},
|
||||
L = {
|
||||
name = "LSP",
|
||||
c = { "<CMD>vim.lsp.buf.code_action<CR>", "Code Action" },
|
||||
b = { "<CMD>FzfLua blines<CR>", "Buffer Lines" },
|
||||
f = { "<CMD>vim.lsp.buf.formatting<CR>", "Formatting" },
|
||||
l = { "<CMD>vim.diagnostic.setloclist<CR>", "Set Loclist" },
|
||||
r = { "<CMD>vim.lsp.buf.rename<CR>", "Rename" },
|
||||
t = { "<CMD>vim.lsp.buf.type_definition<CR>", "Type Definition" },
|
||||
w = { "<CMD>function() print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", "List Workspace Folder" },
|
||||
a = { "<CMD>vim.lsp.buf.add_workspace_folder<CR>", "Add Workspace" },
|
||||
v = { "<CMD>vim.lsp.buf.remove_workspace_folder<CR>", "Remove Workspace" },
|
||||
},
|
||||
P = { "<CMD>Telescope projects<CR>", "Projects" },
|
||||
Q = { "<CMD>q!<CR>", "Quit" },
|
||||
R = { "<CMD>luafile %<CR>", "Reload File" },
|
||||
T = {
|
||||
name = "Text Editing",
|
||||
s = { "<CMD>:set spell!<CR>", "Spell Checking" },
|
||||
d = { "<CMD>call SpellEn()<CR>", "Set Spelling Language to English" },
|
||||
e = { "<CMD>call SpellDe()<CR>", "Set Spelling Languate to German" },
|
||||
w = { "<CMD>call ToggleWrap()<CR>", "Soft wrap/No wrap" },
|
||||
c = { "<CMD>call ToggleColorColumn()<CR>", "Show/Hide Colorcolumn" },
|
||||
m = { "<CMD>MarkdownPreviewToggle<CR>", "Markdown Preview" },
|
||||
},
|
||||
V = {
|
||||
name = "Vimux",
|
||||
p = { "<CMD>VimuxPromptCommand<CR>", "Run Prompt Command" },
|
||||
l = { "<CMD>VimuxRunLastCommand<CR>", "Run Last Command" },
|
||||
t = { "<CMD>VimuxTogglePane<CR>", "Toggle Pane" },
|
||||
j = { "<CMD>RunJest<CR>", "Run Jest" },
|
||||
b = { "<CMD>RunJestOnBuffer<CR>", "Run Jest on Buffer" },
|
||||
f = { "<CMD>RunJestFocused<CR>", "Run Jest on Focused" },
|
||||
},
|
||||
}
|
||||
|
||||
local setup = {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20, -- how many suggestions should be shown in the list?
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
-- operators = { gc = "Comments" },
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn’t effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
-- ["<CR>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it’s label
|
||||
group = "+", -- symbol prepended to a group
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "rounded", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = true, -- enable this to hide mappings for which you didn’t specify a label
|
||||
hidden = { "<silent>", "<CMD>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
|
||||
show_help = true, -- show help message on the command line when the popup is visible
|
||||
triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specify a list manually
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local vopts = {
|
||||
mode = "v", -- VISUAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local vmappings = {
|
||||
["/"] = { '<ESC><CMD>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>', "Comment" },
|
||||
}
|
||||
|
||||
which_key.setup(setup)
|
||||
which_key.register(mappings, opts)
|
||||
which_key.register(vmappings, vopts)
|
||||
@@ -1,137 +0,0 @@
|
||||
" *** *** *** Key Mappings *** *** ***
|
||||
" ************************************
|
||||
|
||||
" Quick toggle between buffers
|
||||
noremap <leader>j :b#<CR>
|
||||
|
||||
" Add semicolon or comma to the end of the line
|
||||
nnoremap ;; A;<ESC>
|
||||
nnoremap ,, A,<ESC>
|
||||
|
||||
" Maintain the cursor position when yanking a visual selection
|
||||
vnoremap y myy`y
|
||||
vnoremap Y myY`y
|
||||
|
||||
" Delete last character of line
|
||||
nnoremap <leader>x $x
|
||||
|
||||
" Open vim config in a new buffer, reload vim config
|
||||
nnoremap <leader>ve :e $MYVIMRC<CR>
|
||||
nnoremap <leader>vr :source $MYVIMRC<CR>
|
||||
|
||||
" Delete current buffer
|
||||
nnoremap <silent> <leader>X :bd<CR>
|
||||
|
||||
" Delete all buffers
|
||||
nnoremap <silent> <leader>da :bufdo bdelete<CR>
|
||||
|
||||
" Save current buffer
|
||||
nnoremap <silent> <leader>sf :w<CR>
|
||||
|
||||
" Allow gf to open non-existent files
|
||||
map gf :edit <cfile><CR>
|
||||
|
||||
" Reselect visual selection after indenting
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
|
||||
" Set spell checker to `s`
|
||||
" zg (good), zG (good temp), zw (wrong), zW (wrong temp)
|
||||
nnoremap <silent> <leader>rs :set spell!<CR>
|
||||
|
||||
" Switch off highlighting
|
||||
nnoremap <silent> <leader>h :nohlsearch<CR>
|
||||
|
||||
" Toogle list
|
||||
nnoremap <leader>l :set list!<CR>
|
||||
|
||||
" Indent the whole source code
|
||||
nnoremap <leader>pf gg=G''
|
||||
|
||||
" Reverse the mark mapping
|
||||
nnoremap ' `
|
||||
nnoremap ` '
|
||||
|
||||
" Visuall select of just pasted content
|
||||
nnoremap gp `[v`]
|
||||
nnoremap gy `[v`]y
|
||||
|
||||
" When text is wrapped, move by terminal rows, not lines, unless a count is provided
|
||||
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
|
||||
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
|
||||
|
||||
" Open a quickfix window for the last search
|
||||
nnoremap <silent> <leader>? :execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>
|
||||
|
||||
" Faster linewise scrolling
|
||||
noremap <C-e> 3<C-e>
|
||||
noremap <C-y> 3<C-y>
|
||||
|
||||
" Keep the window centered
|
||||
noremap G Gzzzv
|
||||
noremap n nzzzv
|
||||
noremap N Nzzzv
|
||||
noremap } }zzzv
|
||||
noremap { {zzzv
|
||||
|
||||
" Close all buffers
|
||||
nnoremap XX :qa<CR>
|
||||
|
||||
" Add lines in NORMAL Mode
|
||||
nnoremap gn o<ESC>k
|
||||
nnoremap gN O<ESC>j
|
||||
|
||||
" Change to the folder of the current file
|
||||
nnoremap <silent> <leader>cf :cd %:p:h<CR>:pwd<CR>
|
||||
|
||||
" Quickfix Window
|
||||
nnoremap <leader>qo :copen<CR>
|
||||
nnoremap <leader>qc :cclose<CR>
|
||||
|
||||
" Exit INSERT MODE with 'jk'
|
||||
inoremap jj <ESC>
|
||||
|
||||
" Reformat a line into a block
|
||||
nnoremap <leader>q gqip
|
||||
|
||||
" Reformat a block into a line
|
||||
nnoremap <leader>qq vipJ
|
||||
|
||||
" Easier split navigation
|
||||
nnoremap <C-J> <C-W><C-J>
|
||||
nnoremap <C-K> <C-W><C-K>
|
||||
nnoremap <C-L> <C-W><C-L>
|
||||
nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
" Mapping for easier OmniCompletion
|
||||
inoremap <C-]> <C-X><C-]>
|
||||
inoremap <C-F> <C-X><C-F>
|
||||
inoremap <C-D> <C-X><C-D>
|
||||
inoremap <C-L> <C-X><C-L>
|
||||
inoremap <C-O> <C-X><C-O>
|
||||
|
||||
" Remap Jump to Tag
|
||||
nnoremap ü <C-]>
|
||||
nnoremap Ü <C-O>
|
||||
|
||||
" Open for Markdown in iA Writer
|
||||
nnoremap <leader>ia :silent !open -a iA\ Writer.app '%:p'<CR>
|
||||
|
||||
" Custom Text Objects
|
||||
let pairs = { ":" : ":",
|
||||
\ "." : ".",
|
||||
\ "<bar>" : "<bar>",
|
||||
\ "*" : "*",
|
||||
\ "-" : "-",
|
||||
\ "_" : "_" }
|
||||
|
||||
for [key, value] in items(pairs)
|
||||
exe "nnoremap ci".key." T".key."ct".value
|
||||
exe "nnoremap ca".key." F".key."cf".value
|
||||
exe "nnoremap vi".key." T".key."vt".value
|
||||
exe "nnoremap va".key." F".key."vf".value
|
||||
exe "nnoremap di".key." T".key."dt".value
|
||||
exe "nnoremap da".key." F".key."df".value
|
||||
exe "nnoremap yi".key." T".key."yt".value
|
||||
exe "nnoremap ya".key." F".key."yf".value
|
||||
endfor
|
||||
@@ -1,36 +0,0 @@
|
||||
" *** *** *** Plugin Configuration *** *** ***
|
||||
" ********************************************
|
||||
|
||||
source ~/.config/nvim/plugin-config/autopairs.lua
|
||||
source ~/.config/nvim/plugin-config/base16.vim
|
||||
source ~/.config/nvim/plugin-config/blamer.vim
|
||||
source ~/.config/nvim/plugin-config/bookmarks.vim
|
||||
source ~/.config/nvim/plugin-config/bufferline.lua
|
||||
source ~/.config/nvim/plugin-config/cmp.lua
|
||||
source ~/.config/nvim/plugin-config/colorizer.lua
|
||||
source ~/.config/nvim/plugin-config/diagnosticls-configs.lua
|
||||
source ~/.config/nvim/plugin-config/export-to-vscode.lua
|
||||
source ~/.config/nvim/plugin-config/fugitive.vim
|
||||
source ~/.config/nvim/plugin-config/fzf.lua
|
||||
source ~/.config/nvim/plugin-config/gitsigns.lua
|
||||
source ~/.config/nvim/plugin-config/vim-gh-line.vim
|
||||
source ~/.config/nvim/plugin-config/goyo.vim
|
||||
source ~/.config/nvim/plugin-config/harpoon.lua
|
||||
source ~/.config/nvim/plugin-config/lsp-config.vim
|
||||
source ~/.config/nvim/plugin-config/lsp-installer.lua
|
||||
source ~/.config/nvim/plugin-config/lspkind.lua
|
||||
source ~/.config/nvim/plugin-config/lualine.lua
|
||||
source ~/.config/nvim/plugin-config/neoscroll.lua
|
||||
source ~/.config/nvim/plugin-config/pandoc.vim
|
||||
source ~/.config/nvim/plugin-config/neoformat.vim
|
||||
source ~/.config/nvim/plugin-config/sidebar.lua
|
||||
source ~/.config/nvim/plugin-config/speeddating.vim
|
||||
source ~/.config/nvim/plugin-config/telescope.lua
|
||||
source ~/.config/nvim/plugin-config/tree.lua
|
||||
source ~/.config/nvim/plugin-config/treesitter.lua
|
||||
source ~/.config/nvim/plugin-config/trouble.lua
|
||||
source ~/.config/nvim/plugin-config/ultisnips.vim
|
||||
source ~/.config/nvim/plugin-config/vim-easymotion.vim
|
||||
source ~/.config/nvim/plugin-config/vim-commentary.vim
|
||||
source ~/.config/nvim/plugin-config/vimux.vim
|
||||
source ~/.config/nvim/plugin-config/web-devicons.lua
|
||||
@@ -1,9 +0,0 @@
|
||||
-- nvim-autopairs
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
local status, autopairs = pcall(require, 'nvim-autopairs')
|
||||
if (not status) then return end
|
||||
|
||||
autopairs.setup({
|
||||
disable_filetype = { 'TelescopePrompt', 'vim' },
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
" Base16 Vim
|
||||
" https://github.com/chriskempson/base16-vim
|
||||
|
||||
if filereadable(expand("~/.vimrc_background"))
|
||||
let base16colorspace=256
|
||||
source ~/.vimrc_background
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
" blamer.vim
|
||||
" https://github.com/APZelos/blamer.nvim
|
||||
|
||||
" Settings
|
||||
let g:blamer_enabled = 0
|
||||
let g:blamer_relative_time = 1
|
||||
|
||||
" Mappings
|
||||
nnoremap <silent> <Leader>tb :BlamerToggle<CR>
|
||||
@@ -1,5 +0,0 @@
|
||||
" vim-bookmarks
|
||||
" https://github.com/MattesGroeger/vim-bookmarks
|
||||
|
||||
let g:bookmark_center = 1
|
||||
let g:bookmark_auto_close = 1
|
||||
@@ -1,55 +0,0 @@
|
||||
-- bufferline.nvim
|
||||
-- https://github.com/akinsho/bufferline.nvim
|
||||
|
||||
local status, bufferline = pcall(require, 'bufferline')
|
||||
if (not status) then return end
|
||||
|
||||
bufferline.setup({
|
||||
highlights = {
|
||||
fill = {
|
||||
guibg = "#282828"
|
||||
},
|
||||
separator_selected = {
|
||||
guifg = "#282828"
|
||||
},
|
||||
separator_visible = {
|
||||
guifg = "#282828"
|
||||
},
|
||||
separator = {
|
||||
guifg = "#282828"
|
||||
}
|
||||
},
|
||||
options = {
|
||||
modified_icon = "●",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
max_name_length = 25,
|
||||
max_prefix_length = 25,
|
||||
enforce_regular_tabs = false,
|
||||
view = "multiwindow",
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
separator_style = "thin",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
return "("..count..")"
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
text_align = "left"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Leader>tp', [[<Cmd>:BufferLinePick<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>tx', [[<Cmd>:BufferLinePickClose<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>H', [[<Cmd>:BufferLineCyclePrev<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>L', [[<Cmd>:BufferLineCycleNext<CR>]], opts)
|
||||
@@ -1,53 +0,0 @@
|
||||
-- nvim-cmp
|
||||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
|
||||
local status, cmp = pcall(require, 'cmp')
|
||||
if (not status) then return end
|
||||
|
||||
cmp.setup({
|
||||
auto_select = false,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["UltiSnips#Anon"](args.body)
|
||||
end
|
||||
},
|
||||
mapping = {
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-x>'] = cmp.mapping.complete(),
|
||||
['<C-y>'] = cmp.config.disable,
|
||||
['<C-e>'] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
['<CR>'] = cmp.mapping({
|
||||
i = cmp.mapping.confirm({ select = true }),
|
||||
c = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'ultisnips' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'path' },
|
||||
{ name = 'omni' },
|
||||
{ name = 'buffer', keyword_length = 3 },
|
||||
{ name = 'npm', keyword_length = 4 },
|
||||
},
|
||||
formatting = {
|
||||
format = require('lspkind').cmp_format {
|
||||
with_text = true,
|
||||
menu = {
|
||||
buffer = "[buf]",
|
||||
nvim_lsp = "[LSP]",
|
||||
path = "[path]",
|
||||
luasnip = "[snip]"
|
||||
}
|
||||
}
|
||||
},
|
||||
experimental = {
|
||||
native_menu = false,
|
||||
ghost_text = true
|
||||
}
|
||||
})
|
||||
@@ -1,17 +0,0 @@
|
||||
-- colorizer.lua
|
||||
-- https://github.com/norcalli/nvim-colorizer.lua
|
||||
|
||||
local status, colorizer = pcall(require, 'colorizer')
|
||||
if (not status) then return end
|
||||
|
||||
colorizer.setup(nil, {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
names = true, -- "Name" codes like Blue
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
mode = "background", -- Set the display mode.)
|
||||
})
|
||||
@@ -1,53 +0,0 @@
|
||||
-- diagnosticls-configs-nvim
|
||||
-- https://github.com/creativenull/diagnosticls-configs-nvim#setup
|
||||
|
||||
local status, dlsconfig = pcall(require, 'diagnosticls-configs')
|
||||
if (not status) then return end
|
||||
|
||||
-- npm install -g diagnostic-languageserver eslint_d prettier_d_slim prettier
|
||||
local eslint = require('diagnosticls-configs.linters.eslint')
|
||||
local standard = require('diagnosticls-configs.linters.standard')
|
||||
local prettier = require('diagnosticls-configs.formatters.prettier')
|
||||
local prettier_standard = require('diagnosticls-configs.formatters.prettier_standard')
|
||||
|
||||
local function on_attach(client)
|
||||
print('Attached to ' .. client.name)
|
||||
end
|
||||
|
||||
dlsconfig.init({
|
||||
default_config = true,
|
||||
format = true,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
prettier.requiredFiles = {
|
||||
'.prettierrc',
|
||||
'.prettierrc.json',
|
||||
'.prettierrc.toml',
|
||||
'.prettierrc.json',
|
||||
'.prettierrc.yml',
|
||||
'.prettierrc.yaml',
|
||||
'.prettierrc.json5',
|
||||
'.prettierrc.js',
|
||||
'.prettierrc.cjs',
|
||||
'prettier.config.js',
|
||||
'prettier.config.cjs',
|
||||
}
|
||||
|
||||
dlsconfig.setup({
|
||||
['javascript'] = {
|
||||
linter = { eslint, standard },
|
||||
formatter = { prettier, prettier_standard },
|
||||
},
|
||||
['javascriptreact'] = {
|
||||
linter = { eslint, standard },
|
||||
formatter = { prettier, prettier_standard }
|
||||
},
|
||||
['css'] = {
|
||||
formatter = prettier
|
||||
},
|
||||
['html'] = {
|
||||
formatter = prettier
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
--- export-to-vscode.nvim
|
||||
-- https://github.com/elijahmanor/export-to-vscode.nvim
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>code', '<cmd>lua require("export-to-vscode").launch()<cr>', { noremap = true, silent = true })
|
||||
@@ -1,6 +0,0 @@
|
||||
" fugitive.vim
|
||||
" https://github.com/tpope/vim-fugitive
|
||||
|
||||
nnoremap <leader>gd :Gvdiffsplit!<CR>
|
||||
nnoremap gdh :diffget //2<CR>
|
||||
nnoremap gdl :diffget //3<CR>
|
||||
@@ -1,25 +0,0 @@
|
||||
-- fzf.nvim
|
||||
-- https://github.com/nvim-telescope/telescope.nvim/
|
||||
|
||||
--- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<C-p>', [[<Cmd>Files<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>b', [[<Cmd>Buffers<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>gs', [[<Cmd>GFiles?<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fc', [[<Cmd>Commits<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fbc', [[<Cmd>BCommits<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>ht', [[<Cmd>Helptags<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>r', [[<Cmd>Rg<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>rf', [[<Cmd>Rg!<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>t', [[<Cmd>Tags<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>m', [[<Cmd>Marks<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>km', [[<Cmd>Maps<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fl', [[<Cmd>Lines<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fbl', [[<Cmd>BLines<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>w', [[<Cmd>Windows<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>mru', [[<Cmd>History<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>ch', [[<Cmd>History:<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>sh', [[<Cmd>History/<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fs', [[<Cmd>Snippets<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>ff', [[<Cmd>Filetypes<CR>]], opts)
|
||||
@@ -1,7 +0,0 @@
|
||||
-- gitsigns.nvim
|
||||
-- https://github.com/lewis6991/gitsigns.nvim
|
||||
|
||||
local status, gitsigns = pcall(require, 'gitsigns')
|
||||
if (not status) then return end
|
||||
|
||||
gitsigns.setup()
|
||||
@@ -1,17 +0,0 @@
|
||||
-- Harpoon
|
||||
-- https://github.com/ThePrimeagen/harpoon
|
||||
|
||||
local status, harpoon = pcall(require, 'harpoon')
|
||||
if (not status) then return end
|
||||
|
||||
harpoon.setup()
|
||||
|
||||
-- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>a', [[<Cmd>lua require('harpoon.mark').add_file()<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>,', [[<Cmd>lua require('harpoon.ui').toggle_quick_menu()<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>1', [[<Cmd>lua require('harpoon.ui').nav_file(1)<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>2', [[<Cmd>lua require('harpoon.ui').nav_file(2)<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>3', [[<Cmd>lua require('harpoon.ui').nav_file(3)<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>4', [[<Cmd>lua require('harpoon.ui').nav_file(4)<CR>]], opts)
|
||||
@@ -1,21 +0,0 @@
|
||||
" lspconfig
|
||||
" https://github.com/neovim/nvim-lspconfig
|
||||
|
||||
" Mappings
|
||||
nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
|
||||
nnoremap <silent> <leader>D <cmd>lua vim.lsp.buf.type_definition()<CR>
|
||||
nnoremap <silent> <leader>q <cmd>lua vim.lsp.diagnostic.set_loclist()<CR>
|
||||
nnoremap <silent> <leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
|
||||
nnoremap <silent> <leader>wa <cmd>lua vim.lsp.buf.add_workspace_folder()<CR>
|
||||
nnoremap <silent> <leader>wl <cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>
|
||||
nnoremap <silent> <leader>wr <cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>
|
||||
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
||||
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
|
||||
nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>
|
||||
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
|
||||
nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
|
||||
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
|
||||
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
||||
nnoremap <silent> Ä <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
|
||||
nnoremap <silent> ä <cmd>lua vim.lsp.diagnostic.goto_next()<CR>
|
||||
@@ -1,63 +0,0 @@
|
||||
-- nvim-lsp-installer
|
||||
-- https://github.com/williamboman/nvim-lsp-installer
|
||||
|
||||
local status, lsp_installer = pcall(require, 'nvim-lsp-installer')
|
||||
if (not status) then return end
|
||||
|
||||
local servers = {
|
||||
bashls = {},
|
||||
cssls = {},
|
||||
diagnosticls = {},
|
||||
dockerls = {},
|
||||
emmet_ls = {},
|
||||
eslint = {},
|
||||
graphql = {},
|
||||
html = {},
|
||||
jsonls = {},
|
||||
pyright = {},
|
||||
sumneko_lua = {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = {"vim", "hs"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
stylelint_lsp = {},
|
||||
svelte = {},
|
||||
tailwindcss = {},
|
||||
tsserver = {},
|
||||
vimls = {},
|
||||
vuels = {},
|
||||
yamlls = {},
|
||||
}
|
||||
|
||||
lsp_installer.settings({
|
||||
ui = {
|
||||
icons = {
|
||||
server_installed = "✓",
|
||||
server_pending = "➜",
|
||||
server_uninstalled = "✗"
|
||||
},
|
||||
},
|
||||
|
||||
max_concurrent_installers = 4,
|
||||
})
|
||||
|
||||
-- Register a handler that will be called for all installed servers.
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
local opts = {
|
||||
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||
}
|
||||
|
||||
if servers[server.name] then
|
||||
opts = servers[server.name]
|
||||
end
|
||||
|
||||
-- This setup() function is exactly the same as lspconfig's setup function.
|
||||
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
server:setup(opts)
|
||||
|
||||
vim.cmd([[do User LspAttachBuffers]])
|
||||
end)
|
||||
@@ -1,7 +0,0 @@
|
||||
-- lspkind-nvim
|
||||
-- https://github.com/onsails/lspkind-nvim
|
||||
|
||||
local status, lspkind = pcall(require, 'lspkind')
|
||||
if (not status) then return end
|
||||
|
||||
lspkind.init({})
|
||||
@@ -1,41 +0,0 @@
|
||||
-- lualine.nvim
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
|
||||
local status, lualine = pcall(require, 'lualine')
|
||||
if (not status) then return end
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
file_status = true,
|
||||
path = 1,
|
||||
}
|
||||
},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
" Neoformat
|
||||
" https://github.com/sbdchd/neoformat
|
||||
|
||||
" Settings
|
||||
let g:neoformat_try_node_exe = 1
|
||||
let g:neoformat_run_all_formatters = 1
|
||||
let g:neoformat_basic_format_align = 0 " Disable alignment
|
||||
let g:neoformat_basic_format_retab = 1 " Enable tab to spaces conversion
|
||||
let g:neoformat_basic_format_trim = 1 " Enable trimmming of trailing whitespace
|
||||
|
||||
" Mappings
|
||||
nnoremap <silent> nf <cmd>Neoformat<CR>
|
||||
|
||||
" Auto Commands
|
||||
augroup fmt
|
||||
autocmd!
|
||||
autocmd BufWritePre * undojoin | Neoformat
|
||||
augroup END
|
||||
@@ -1,7 +0,0 @@
|
||||
-- Neoscroll
|
||||
-- https://github.com/karb94/neoscroll.nvim
|
||||
|
||||
local status, neoscroll = pcall(require, 'neoscroll')
|
||||
if (not status) then return end
|
||||
|
||||
neoscroll.setup()
|
||||
@@ -1,6 +0,0 @@
|
||||
" vim-pandoc
|
||||
" https://github.com/vim-pandoc/vim-pandoc
|
||||
|
||||
let g:pandoc#modules#disabled = ["folding", "chdir"]
|
||||
let g:pandoc#spell#default_langs = ['de_de', 'en_us']
|
||||
let g:pandoc#spell#enabled = 0
|
||||
@@ -1,18 +0,0 @@
|
||||
" Settings
|
||||
let g:prettier#autoformat = 1
|
||||
let g:prettier#autoformat_require_pragma = 0
|
||||
let g:prettier#exec_cmd_async = 1
|
||||
let g:prettier#exec_cmd_path = "/usr/local/bin/prettier"
|
||||
|
||||
" Autocommands
|
||||
augroup prettier
|
||||
autocmd!
|
||||
autocmd FileType css,scss let b:prettier_exec_cmd = 'prettier-stylelint'
|
||||
autocmd BufWritePre *.js PrettierAsync
|
||||
autocmd BufWritePre *.jsx PrettierAsync
|
||||
autocmd BufWritePre *.ts PrettierAsync
|
||||
autocmd BufWritePre *.tsx PrettierAsync
|
||||
autocmd BufWritePre *.css PrettierAsync
|
||||
autocmd BufWritePre *.scss PrettierAsync
|
||||
autocmd BufWritePre *.md PrettierAsync
|
||||
augroup END
|
||||
@@ -1,9 +0,0 @@
|
||||
local status, sidebar = pcall(require, 'sidebar-nvim')
|
||||
if (not status) then return end
|
||||
|
||||
sidebar.setup()
|
||||
|
||||
--- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>ts', [[<Cmd>:SidebarNvimToggle<CR>]], opts)
|
||||
@@ -1,4 +0,0 @@
|
||||
" speeddating.vim
|
||||
" https://github.com/tpope/vim-speeddating
|
||||
|
||||
autocmd VimEnter * SpeedDatingFormat %d.%m.%Y
|
||||
@@ -1,86 +0,0 @@
|
||||
-- telescope.nvim
|
||||
-- https://github.com/nvim-telescope/telescope.nvim/
|
||||
|
||||
local status, telescope = pcall(require, 'telescope')
|
||||
if (not status) then return end
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
file_ignore_pattern = { 'yarn.lock' }
|
||||
},
|
||||
extensions = {
|
||||
lsp_handlers = {
|
||||
disable = {},
|
||||
location = {
|
||||
telescope = {},
|
||||
no_results_message = 'No references found',
|
||||
},
|
||||
symbol = {
|
||||
telescope = {},
|
||||
no_results_message = 'No symbols found',
|
||||
},
|
||||
call_hierarchy = {
|
||||
telescope = {},
|
||||
no_results_message = 'No calls found',
|
||||
},
|
||||
code_action = {
|
||||
telescope = require('telescope.themes').get_dropdown({}),
|
||||
no_results_message = 'No code actions available',
|
||||
prefix = '',
|
||||
},
|
||||
},
|
||||
bookmarks = {
|
||||
selected_browser = 'brave',
|
||||
url_open_command = 'open',
|
||||
}
|
||||
},
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = false,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case"
|
||||
},
|
||||
buffers = {
|
||||
show_all_buffers = true,
|
||||
sort_lastused = true,
|
||||
-- theme = "dropdown",
|
||||
-- previewer = false,
|
||||
mappings = {
|
||||
i = {
|
||||
["<M-d>"] = "delete_buffer",
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
--- Extensions
|
||||
require('telescope').load_extension('bookmarks')
|
||||
require('telescope').load_extension('frecency')
|
||||
require('telescope').load_extension('fzf')
|
||||
require('telescope').load_extension('harpoon')
|
||||
require('telescope').load_extension('lsp_handlers')
|
||||
require('telescope').load_extension('node_modules')
|
||||
|
||||
--- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Leader>bh', [[<Cmd>Telescope bookmarks<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>cheat', [[<Cmd>:Cheatsheet<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fcb', [[<Cmd>Telescope git_branches<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fnm', [[<Cmd>Telescope node_modules list<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>fr', [[<Cmd>Telescope resume<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<C-p>', [[<Cmd>Telescope find_files<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>b', [[<Cmd>Telescope buffers<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>fb', [[<Cmd>Telescope buffers<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>fc', [[<Cmd>Telescope git_status<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>ff', [[<Cmd>lua require('telescope.builtin').find_files({ hidden = true })<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>fht', [[<Cmd>Telescope help_tags<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>frg', [[<Cmd>Telescope live_grep<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>fs', [[<Cmd>lua require('telescope.builtin').file_browser({ cwd = vim.fn.expand('%:p:h') })<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>ft', [[<Cmd>Telescope tags<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>km', [[<Cmd>Telescope keymaps<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>m', [[<Cmd>Telescope marks<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>mru', [[<Cmd>Telescope frecency<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>ps', [[<Cmd>lua require('telescope.builtin').grep_string({ search = vim.fn.input('Grep for > ') })<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>r', [[<Cmd>Telescope live_grep<CR>]], opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<Leader>t', [[<Cmd>Telescope tags<CR>]], opts)
|
||||
@@ -1,109 +0,0 @@
|
||||
-- nvim-tree.lua
|
||||
-- https://github.com/kyazdani42/nvim-tree.lua
|
||||
|
||||
local status, nvim_tree = pcall(require, 'nvim-tree')
|
||||
if (not status) then return end
|
||||
|
||||
require'nvim-tree'.setup {
|
||||
auto_reload_on_write = true,
|
||||
disable_netrw = false,
|
||||
hide_root_folder = false,
|
||||
hijack_cursor = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
ignore_buffer_on_setup = false,
|
||||
open_on_setup = false,
|
||||
open_on_setup_file = false,
|
||||
open_on_tab = false,
|
||||
sort_by = "name",
|
||||
update_cwd = false,
|
||||
view = {
|
||||
width = 50,
|
||||
height = 30,
|
||||
side = "left",
|
||||
preserve_window_proportions = false,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
-- user mappings go here
|
||||
},
|
||||
},
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = false,
|
||||
update_cwd = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
ignore_ft_on_setup = {},
|
||||
system_open = {
|
||||
cmd = nil,
|
||||
args = {},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
show_on_dirs = false,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {},
|
||||
exclude = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 400,
|
||||
},
|
||||
actions = {
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = false,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
require_confirm = true,
|
||||
},
|
||||
log = {
|
||||
enable = false,
|
||||
truncate = false,
|
||||
types = {
|
||||
all = false,
|
||||
config = false,
|
||||
copy_paste = false,
|
||||
git = false,
|
||||
profile = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
--- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>nt', [[<Cmd>:NvimTreeToggle<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>ntf', [[<Cmd>:NvimTreeFindFile<CR>]], opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>ntr', [[<Cmd>:NvimTreeRefresh<CR>]], opts)
|
||||
@@ -1,41 +0,0 @@
|
||||
-- nvim-treesitter
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||
|
||||
local status, treesitter = pcall(require, 'nvim-treesitter')
|
||||
if (not status) then return end
|
||||
|
||||
treesitter.setup {
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'css',
|
||||
'dockerfile',
|
||||
'graphql',
|
||||
'html',
|
||||
'javascript',
|
||||
'jsdoc',
|
||||
'json',
|
||||
'lua',
|
||||
'python',
|
||||
'ruby',
|
||||
'scss',
|
||||
'svelte',
|
||||
'toml',
|
||||
'tsx',
|
||||
'typescript',
|
||||
'vim',
|
||||
'vue',
|
||||
'yaml',
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
additional_vim_regex_highlighting = true
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
-- Trouble
|
||||
-- https://github.com/folke/trouble.nvim
|
||||
|
||||
local status, trouble = pcall(require, 'trouble')
|
||||
if (not status) then return end
|
||||
|
||||
trouble.setup()
|
||||
|
||||
--- Mappings
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>tt', [[<Cmd>:TroubleToggle<CR>]], opts)
|
||||
@@ -1,13 +0,0 @@
|
||||
" UltiSnips
|
||||
" https://github.com/SirVer/ultisnips
|
||||
|
||||
let g:UltiSnipsSnippetDirectories = ["ultisnips"]
|
||||
let g:UltiSnipsExpandTrigger="<tab>"
|
||||
let g:UltiSnipsJumpForwardTrigger="<c-j>"
|
||||
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
|
||||
let g:UltiSnipsEditSplit="vertical"
|
||||
let g:ultisnips_javascript = {
|
||||
\ 'keyword-spacing': 'always',
|
||||
\ 'semi': 'always',
|
||||
\ 'space-before-function-paren': 'never'
|
||||
\ }
|
||||
@@ -1,6 +0,0 @@
|
||||
" commentary.vim
|
||||
" https://github.com/tpope/vim-commentary
|
||||
|
||||
autocmd FileType apache setlocal commentstring=#\ %s
|
||||
autocmd FileType gspec setlocal commentstring=#\ %s
|
||||
autocmd FileType eruby setlocal commentstring=<!--%s-->
|
||||
@@ -1,10 +0,0 @@
|
||||
" vim-easymotion
|
||||
" https://github.com/easymotion/vim-easymotion
|
||||
|
||||
" <Leader>f{char} to move to {char}
|
||||
map <Leader>f <Plug>(easymotion-bd-f)
|
||||
nmap <Leader>f <Plug>(easymotion-overwin-f)
|
||||
|
||||
" Move to line
|
||||
map <Leader>L <Plug>(easymotion-bd-jk)
|
||||
nmap <Leader>L <Plug>(easymotion-overwin-line)
|
||||
@@ -1,4 +0,0 @@
|
||||
" vim-gh-line
|
||||
" https://github.com/ruanyl/vim-gh-line
|
||||
|
||||
let g:gh_github_domain = "source.xing.com"
|
||||
@@ -1,14 +0,0 @@
|
||||
" Vimux
|
||||
" https://github.com/preservim/vimux
|
||||
|
||||
let g:VimuxHeight = "30"
|
||||
let g:VimuxOrientation = 'h'
|
||||
let g:VimuxUseNearestPane = 0
|
||||
|
||||
" Mappings
|
||||
nmap <leader>vt :VimuxTogglePane<CR>
|
||||
nmap <leader>vp :VimuxPromptCommand<CR>
|
||||
nmap <leader>vl :VimuxRunLastCommand<CR>
|
||||
nmap <leader>vj :RunJest<CR>
|
||||
nmap <leader>vjb :RunJestOnBuffer<CR>
|
||||
nmap <leader>vjf :RunJestFocused<CR>
|
||||
@@ -1,10 +0,0 @@
|
||||
-- nvim-web-devicons
|
||||
-- https://github.com/kyazdani42/nvim-web-devicons
|
||||
|
||||
local status, web_devicons = pcall(require, 'nvim-web-devicons')
|
||||
if (not status) then return end
|
||||
|
||||
web_devicons.setup({
|
||||
override = {},
|
||||
default = true,
|
||||
})
|
||||
117
nvim/plugins.vim
117
nvim/plugins.vim
@@ -1,117 +0,0 @@
|
||||
" *** *** *** Plugins *** *** ***
|
||||
" *******************************
|
||||
|
||||
" Automatically install vim-plug
|
||||
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||
silent execute '!curl -fLo ' . data_dir . '/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||
endif
|
||||
|
||||
call plug#begin(data_dir . '/plugins')
|
||||
|
||||
" Language Server Protocol
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'williamboman/nvim-lsp-installer'
|
||||
Plug 'folke/trouble.nvim'
|
||||
Plug 'onsails/lspkind-nvim'
|
||||
Plug 'creativenull/diagnosticls-configs-nvim'
|
||||
|
||||
" Completion
|
||||
Plug 'hrsh7th/nvim-cmp'
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
Plug 'hrsh7th/cmp-buffer'
|
||||
Plug 'hrsh7th/cmp-path'
|
||||
Plug 'hrsh7th/cmp-cmdline'
|
||||
Plug 'SirVer/ultisnips'
|
||||
Plug 'honza/vim-snippets'
|
||||
Plug 'quangnguyen30192/cmp-nvim-ultisnips'
|
||||
Plug 'David-Kunz/cmp-npm'
|
||||
|
||||
" File Management & File Editing
|
||||
Plug 'APZelos/blamer.nvim'
|
||||
Plug 'MattesGroeger/vim-bookmarks'
|
||||
Plug 'ThePrimeagen/harpoon'
|
||||
Plug 'bogado/file-line'
|
||||
Plug 'dhruvmanila/telescope-bookmarks.nvim'
|
||||
Plug 'gbrlsnchs/telescope-lsp-handlers.nvim'
|
||||
Plug 'godlygeek/tabular'
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'kyazdani42/nvim-tree.lua'
|
||||
Plug 'lewis6991/gitsigns.nvim'
|
||||
Plug 'mg979/vim-visual-multi'
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'nvim-lua/popup.nvim'
|
||||
Plug 'nvim-telescope/telescope-file-browser.nvim'
|
||||
Plug 'nvim-telescope/telescope-frecency.nvim'
|
||||
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' }
|
||||
Plug 'nvim-telescope/telescope-node-modules.nvim'
|
||||
Plug 'nvim-telescope/telescope.nvim'
|
||||
Plug 'sbdchd/neoformat'
|
||||
Plug 'ruanyl/vim-gh-line'
|
||||
Plug 'sidebar-nvim/sidebar.nvim'
|
||||
Plug 'sudormrfbin/cheatsheet.nvim'
|
||||
Plug 'tami5/sqlite.lua'
|
||||
Plug 'vim-scripts/VisIncr'
|
||||
Plug 'windwp/nvim-autopairs'
|
||||
Plug 'elijahmanor/export-to-vscode.nvim'
|
||||
Plug 'brooth/far.vim'
|
||||
Plug 'rstacruz/vim-xtract'
|
||||
|
||||
" Window Improvements
|
||||
Plug 'akinsho/bufferline.nvim'
|
||||
Plug 'chriskempson/base16-vim'
|
||||
Plug 'dstein64/vim-startuptime'
|
||||
Plug 'hoob3rt/lualine.nvim'
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'karb94/neoscroll.nvim'
|
||||
Plug 'kyazdani42/nvim-web-devicons'
|
||||
Plug 'wesQ3/vim-windowswap'
|
||||
Plug 'yamatsum/nvim-cursorline'
|
||||
|
||||
" Syntax Highlighting
|
||||
Plug 'JoosepAlviste/nvim-ts-context-commentstring'
|
||||
Plug 'editorconfig/editorconfig-vim'
|
||||
Plug 'jparise/vim-graphql'
|
||||
Plug 'jxnblk/vim-mdx-js'
|
||||
Plug 'mattn/emmet-vim'
|
||||
Plug 'norcalli/nvim-colorizer.lua'
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
Plug 'peitalin/vim-jsx-typescript'
|
||||
Plug 'sheerun/vim-polyglot'
|
||||
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
|
||||
Plug 'vim-pandoc/vim-pandoc'
|
||||
Plug 'vim-pandoc/vim-pandoc-syntax'
|
||||
Plug 'pantharshit00/vim-prisma'
|
||||
|
||||
" Custom Text Objects
|
||||
Plug 'christoomey/vim-titlecase'
|
||||
Plug 'glts/vim-textobj-comment' " ac, ic, aC
|
||||
Plug 'jceb/vim-textobj-uri' " au, iu, go
|
||||
Plug 'kana/vim-textobj-datetime' " ada, add, adf, adt, adz, ida, …
|
||||
Plug 'kana/vim-textobj-user'
|
||||
Plug 'michaeljsmith/vim-indent-object' " ai, ii, aI, iI
|
||||
Plug 'whatyouhide/vim-textobj-xmlattr' " ax, ix
|
||||
|
||||
" Custom Motions
|
||||
Plug 'christoomey/vim-sort-motion' " gs
|
||||
Plug 'tommcdo/vim-exchange' " cx, cxx, X, cxc
|
||||
Plug 'easymotion/vim-easymotion' " <Leader>f/L
|
||||
|
||||
" Tpope
|
||||
Plug 'tpope/vim-abolish'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-eunuch'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'tpope/vim-repeat'
|
||||
Plug 'tpope/vim-speeddating'
|
||||
Plug 'tpope/vim-surround'
|
||||
|
||||
" TMUX
|
||||
Plug 'christoomey/vim-tmux-navigator'
|
||||
Plug 'preservim/vimux'
|
||||
Plug 'tyewang/vimux-jest-test'
|
||||
|
||||
call plug#end()
|
||||
doautocmd User PlugLoaded
|
||||
@@ -1,83 +0,0 @@
|
||||
" *** *** *** Global Settings *** *** ***
|
||||
" ***************************************
|
||||
|
||||
set expandtab
|
||||
set autowrite
|
||||
set showbreak=↪
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set list
|
||||
set listchars=tab:∙\ ,trail:·,nbsp:.,extends:❯,precedes:❮
|
||||
set visualbell
|
||||
set termguicolors
|
||||
set number
|
||||
set relativenumber
|
||||
set backspace=indent,eol,start " Intuitive backspacing
|
||||
set hidden
|
||||
set iskeyword+=- " Add dashes to words
|
||||
set cpoptions+=$ " Don't delete the word, but put a $ to the end till exit the mode
|
||||
set title
|
||||
set shortmess=caoOtI " Welcome screen
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
||||
set softtabstop=2
|
||||
set expandtab
|
||||
set copyindent
|
||||
set shiftround
|
||||
set mouse=a
|
||||
set clipboard=unnamedplus
|
||||
set nowrap
|
||||
set confirm
|
||||
set spelllang=de_de,en_us
|
||||
set timeoutlen=500
|
||||
set signcolumn=yes:2
|
||||
set foldlevel=2
|
||||
set foldlevelstart=99
|
||||
set foldmethod=syntax
|
||||
set foldnestmax=10
|
||||
set splitbelow
|
||||
set splitright
|
||||
set scrolloff=8
|
||||
set sidescrolloff=8
|
||||
set virtualedit=all
|
||||
set cursorline
|
||||
set path+=**
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
set noswapfile
|
||||
set undofile
|
||||
set redrawtime=10000 " Allow more time for loading syntax on large files
|
||||
set complete+=i,k,s,kspell
|
||||
set completeopt=menu,menuone,preview
|
||||
set wildmode=longest:full,full
|
||||
set omnifunc=syntaxcomplete#Complete
|
||||
set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case
|
||||
set grepformat=%f:%l:%c:%m
|
||||
|
||||
" Spell Checker
|
||||
set spellfile+=~/.config/nvim/spell/de.utf-8.add " (1)zg, (1)zw
|
||||
set spellfile+=~/.vim/spell/en.utf-8.add " 2zg, 2zw
|
||||
|
||||
" Custom Dictionaries (<C-x> <C-k>)
|
||||
set dictionary+=~/.config/nvim/dictionary/de_user.txt
|
||||
set dictionary+=~/.config/nvim/dictionary/de_neu.txt
|
||||
set dictionary+=~/.config/nvim/dictionary/en_us.txt
|
||||
|
||||
" Custom Thesauri (Synonyms) (<C-x> <C-t>)
|
||||
set thesaurus+=~/.config/nvim/thesaurus/de_user.txt
|
||||
set thesaurus+=~/.config/nvim/thesaurus/de_openthesaurus.txt
|
||||
|
||||
" Python paths
|
||||
let g:python_host_prog=$HOME.'/.pyenv/versions/neovim2/bin/python'
|
||||
let g:python3_host_prog=$HOME.'/.pyenv/versions/neovim3/bin/python'
|
||||
|
||||
" Custom Colors
|
||||
highlight ColorColumn guibg=#202224
|
||||
highlight SpellBad guifg=red
|
||||
|
||||
" Show VCS conflict marker
|
||||
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
|
||||
|
||||
" Leader
|
||||
let mapleader = "\<space>"
|
||||
|
||||
200
nvim/spell/de.utf-8.add
Normal file → Executable file
200
nvim/spell/de.utf-8.add
Normal file → Executable file
@@ -1,200 +0,0 @@
|
||||
Imhoff
|
||||
kogakure
|
||||
Ninjutsu
|
||||
Bujinkan
|
||||
Wolfburg
|
||||
Masaaki
|
||||
Hatsumi
|
||||
Dumrath
|
||||
Fassnacht
|
||||
Arbeitsverzeichnis
|
||||
Zeichencodierung
|
||||
XING
|
||||
Karriereplanung
|
||||
Webdesigner
|
||||
Vim
|
||||
TextMate
|
||||
Javascript
|
||||
Nervenpunkte
|
||||
Atemi
|
||||
Schlagdosierung
|
||||
Trefferzonen
|
||||
Dakentaijutsu
|
||||
Koppojutsu
|
||||
Knochenbrechtechniken
|
||||
Koshijutsu
|
||||
Körperwaffen
|
||||
abzuhärten
|
||||
Körperwaffe
|
||||
Bleischrot
|
||||
Speerhand
|
||||
Takamatsu
|
||||
Seishin
|
||||
Teki
|
||||
Kyoyo
|
||||
Taijutsu
|
||||
taijutsu
|
||||
Jutai
|
||||
jutsu
|
||||
Greiftechniken
|
||||
Taihen
|
||||
Ninjaken
|
||||
Ninjaschwert
|
||||
Iaijutsu
|
||||
Schnellziehen
|
||||
Kenjutsu
|
||||
Bojutsu
|
||||
Rokushakubo
|
||||
Yonshakubo
|
||||
Hanbo
|
||||
Sanshakubo
|
||||
Tessen
|
||||
Shinobi
|
||||
Shuriken
|
||||
Wurfklingen
|
||||
shuriken
|
||||
Senban
|
||||
Wurfmesser
|
||||
Yarijutsu
|
||||
Yari
|
||||
Kamayari
|
||||
Hakenspeer
|
||||
Naginatajutsu
|
||||
Naginata
|
||||
Schwertlanze
|
||||
Bisento
|
||||
Kusarigama
|
||||
Sichelwaffen
|
||||
Kyoketsu
|
||||
shogei
|
||||
Kayakujutsu
|
||||
Hensojutsu
|
||||
Rollendenken
|
||||
iri
|
||||
Gehtechniken
|
||||
Bajutsu
|
||||
Suiren
|
||||
Wassertraining
|
||||
Wasserbewegungen
|
||||
Unterwasserkampf
|
||||
ryaku
|
||||
Schlachtformationen
|
||||
Choho
|
||||
Intonjutsu
|
||||
Gotonpo
|
||||
Tenmon
|
||||
Chimon
|
||||
Landschaftskunde
|
||||
Fahrzeugkenntnis
|
||||
Momochi
|
||||
Sandaju
|
||||
Iga
|
||||
Ryu
|
||||
Führungspersonen
|
||||
Schattenkrieger
|
||||
Nin
|
||||
Shinobu
|
||||
Ninjustu
|
||||
Koga
|
||||
Vorderfaust
|
||||
Faustrücken
|
||||
Handkante
|
||||
Fersenrücken
|
||||
Knöchelfaust
|
||||
Sinusknochen
|
||||
Kehlkopfdeckel
|
||||
Kehlkopfgrube
|
||||
schwert
|
||||
Schlüsselbeinvertiefung
|
||||
Nervendruck
|
||||
Brustbeinfortsatz
|
||||
Herzspitze
|
||||
Schulterblattkamm
|
||||
Spindelbein
|
||||
Faustkante
|
||||
Faustunterseite
|
||||
Schulterlähmung
|
||||
Körperkondition
|
||||
Geta
|
||||
Kampftraining
|
||||
Tritttechniken
|
||||
Grundtechniken
|
||||
Stabkampfes
|
||||
Kettentechniken
|
||||
Klingenwerfen
|
||||
Unterwassertaktiken
|
||||
Kujiin
|
||||
Mikkyo
|
||||
Kujikiri
|
||||
Shugendo
|
||||
Saiminjutsu
|
||||
Fujibayashis
|
||||
Bansenshukai
|
||||
Zentralsüdjapan
|
||||
Fujibayashi
|
||||
Yasuyoshi
|
||||
Tokugawa
|
||||
Hattori
|
||||
Sengokujidai
|
||||
Yo
|
||||
handgebundenen
|
||||
Leitphilosophie
|
||||
Militärstrategie
|
||||
Shoshin
|
||||
Bewusstwerden
|
||||
Bewusstseinswerdung
|
||||
Shochi
|
||||
Spionagemission
|
||||
Ausgleichskonzept
|
||||
Kampfsystems
|
||||
Nachtaktionen
|
||||
Verwirrungstaktiken
|
||||
Mondphasentabellen
|
||||
Navigationsmethoden
|
||||
Gezeitentabellen
|
||||
Kaiserfamilie
|
||||
Familienzweige
|
||||
Otomo
|
||||
Hososto
|
||||
Heinazae
|
||||
Nakahattori
|
||||
Koreyuki
|
||||
Yasuyori
|
||||
Heijiro
|
||||
Yasunori
|
||||
Shimohattori
|
||||
Kamihattori
|
||||
Yahazu
|
||||
Nihon
|
||||
Ienaga
|
||||
Yaguruma
|
||||
Ichitomoe
|
||||
Hanzo
|
||||
Nobunaga
|
||||
Oda
|
||||
Mikawa
|
||||
Takano
|
||||
Nagaoka
|
||||
Echigo
|
||||
Takatori
|
||||
Yamato
|
||||
Ochi
|
||||
Familienzweig
|
||||
Nazo
|
||||
Yasunaga
|
||||
Matsudaira
|
||||
Chigachi
|
||||
Heitaro
|
||||
Uzuchijo
|
||||
Migawa
|
||||
Sandayu
|
||||
Yasutake
|
||||
Yubano
|
||||
Ayama
|
||||
Kunoichi
|
||||
Nagato
|
||||
Gotonjutsu
|
||||
Watari
|
||||
Mitsuhide
|
||||
Homebrew
|
||||
Plugins
|
||||
|
||||
BIN
nvim/spell/de.utf-8.add.spl
Normal file → Executable file
BIN
nvim/spell/de.utf-8.add.spl
Normal file → Executable file
Binary file not shown.
0
nvim/spell/de.utf-8.spl
Normal file → Executable file
0
nvim/spell/de.utf-8.spl
Normal file → Executable file
0
nvim/spell/de.utf-8.sug
Normal file → Executable file
0
nvim/spell/de.utf-8.sug
Normal file → Executable file
9
nvim/spell/en.utf-8.add
Normal file → Executable file
9
nvim/spell/en.utf-8.add
Normal file → Executable file
@@ -1,9 +0,0 @@
|
||||
Homebrew
|
||||
symlinked
|
||||
zsh
|
||||
dotfiles
|
||||
XCode
|
||||
CLI
|
||||
tmux
|
||||
Plugins
|
||||
Dateiänderungen
|
||||
|
||||
BIN
nvim/spell/en.utf-8.add.spl
Normal file → Executable file
BIN
nvim/spell/en.utf-8.add.spl
Normal file → Executable file
Binary file not shown.
0
nvim/spell/en.utf-8.spl
Normal file → Executable file
0
nvim/spell/en.utf-8.spl
Normal file → Executable file
0
nvim/spell/en.utf-8.sug
Normal file → Executable file
0
nvim/spell/en.utf-8.sug
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,2 @@
|
||||
Auto;Automobil;Bleckbüchse;fahrbarer Untersatz;Flunder;Kalesche;Karre;Kiste;Kutsche;Personenkraftwagen;Personenwagen;PKW;Pkw;Schleuder;Schlitten;Wagen
|
||||
Fahrrad;Bike;Drahtesel;Hirsch;Rad;Radl;Velo;Zweirad
|
||||
Auto;Automobil;Blechbüchse;fahrbarer Untersatz;Flunder;Kalesche;Karre;Kiste;Kutsche;Personenkraftwagen;Personenwagen;PKW;Pkw;Schleuder;Schlitten;Wagen
|
||||
Fahrrad;Bike;Drahtesel;Hirsch;Rad;Radl;Velo;Zweirad
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user