Add indent commands
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
local api = vim.api
|
||||
|
||||
-- Disable netrw
|
||||
g.loaded_netrw = 1
|
||||
@@ -7,6 +8,7 @@ g.loaded_netrwPlugin = 1
|
||||
|
||||
-- Settings
|
||||
g.mapleader = " "
|
||||
g.maplocalleader = ","
|
||||
|
||||
opt.backup = false
|
||||
opt.swapfile = false
|
||||
@@ -21,3 +23,27 @@ opt.expandtab = true
|
||||
opt.smartindent = true
|
||||
opt.shiftwidth = 4
|
||||
opt.tabstop = 4
|
||||
|
||||
-- Commands
|
||||
local function indent(n, expand)
|
||||
local size = 4
|
||||
if n ~= "" then size = n end
|
||||
|
||||
-- Number conversion
|
||||
local num = tonumber(size)
|
||||
if num then
|
||||
size = num
|
||||
end
|
||||
|
||||
opt.expandtab = expand
|
||||
opt.shiftwidth = size
|
||||
opt.tabstop = size
|
||||
end
|
||||
|
||||
api.nvim_create_user_command("Tabs", function(v)
|
||||
indent(v.args, false)
|
||||
end, { nargs = "?" })
|
||||
|
||||
api.nvim_create_user_command("Spaces", function(v)
|
||||
indent(v.args, true)
|
||||
end, { nargs = "?" })
|
||||
|
||||
18
lua/plugins/neorg.lua
Normal file
18
lua/plugins/neorg.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
"nvim-neorg/neorg",
|
||||
build = ":Neorg sync-parsers",
|
||||
dependencies = "nvim-lua/plenary.nvim",
|
||||
opts = {
|
||||
load = {
|
||||
["core.defaults"] = {}, -- Loads default behaviour
|
||||
["core.concealer"] = {}, -- Adds pretty icons to your documents
|
||||
["core.dirman"] = { -- Manages Neorg workspaces
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "/Users/ghost/Library/Mobile Documents/com~apple~CloudDocs/Neorg"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ local function config()
|
||||
-- Spectre
|
||||
r = {
|
||||
name = "Spectre",
|
||||
r = { "<cmd>lua require('spectre').open_file_search({select_word=true})<CR>", "Search & Replace" },
|
||||
R = { "<cmd>lua require('spectre').toggle()<CR>", "Replace All" }
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user