changes
This commit is contained in:
parent
926ba239ce
commit
ac6ba45b85
8 changed files with 163 additions and 79 deletions
|
@ -77,9 +77,12 @@ vim.api.nvim_create_user_command("Config", function ()
|
|||
vim.cmd("cd $HOME/.config/nvim")
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command("RetabFile", function ()
|
||||
vim.api.nvim_create_user_command("RetabFile2Spaces", function ()
|
||||
vim.cmd(":set ts=2 sts=2 noet | retab! | set ts=4 sts=4 et | retab!")
|
||||
end, {})
|
||||
vim.api.nvim_create_user_command("RetabFile4SpacesToTab", function ()
|
||||
vim.cmd(":set ts=4 sts=4 noet | retab! | set ts=4 sts=0 noexpandtab | retab!")
|
||||
end, {})
|
||||
|
||||
local function get_makefile_targets()
|
||||
local makefile = "./Makefile"
|
||||
|
@ -129,3 +132,45 @@ vim.api.nvim_create_user_command("Maket", function()
|
|||
end
|
||||
}):find()
|
||||
end, {})
|
||||
|
||||
function get_just_targets()
|
||||
local handle = io.popen("just --summary")
|
||||
local res = handle:read("*a")
|
||||
handle:close()
|
||||
local targets = {}
|
||||
-- insert space seperated targets
|
||||
for target in string.gmatch(res, "%S+") do
|
||||
table.insert(targets, target)
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("Just", function(args)
|
||||
local vimCmd = "TermExec cmd=\"just"
|
||||
if (args["args"]) then
|
||||
vimCmd = vimCmd .. " " .. args["args"]
|
||||
end
|
||||
vimCmd = vimCmd .. "\""
|
||||
vim.cmd(vimCmd)
|
||||
end, {nargs = "*", ["complete"] = function ()
|
||||
return get_just_targets()
|
||||
end})
|
||||
|
||||
vim.api.nvim_create_user_command("Justt", function()
|
||||
local targets = get_makefile_targets()
|
||||
pickers.new({}, {
|
||||
prompt_title = "Run just target",
|
||||
finder = finders.new_table {
|
||||
results = targets
|
||||
},
|
||||
sorter = conf.generic_sorter({}),
|
||||
attach_mappings = function (prompt_bufnr, map)
|
||||
actions.select_default:replace(function ()
|
||||
actions.close(prompt_bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
selection = selection[1]
|
||||
vim.cmd(":Just " .. selection)
|
||||
end)
|
||||
return true
|
||||
end
|
||||
}):find()
|
||||
end, {})
|
||||
|
|
|
@ -132,14 +132,17 @@ return {
|
|||
{
|
||||
"mg979/vim-visual-multi",
|
||||
config = function ()
|
||||
vim.cmd("let g:VM_leader='<Space>m'")
|
||||
vim.cmd([[
|
||||
let g:VM_leader='<Space>m'
|
||||
let g:VM_maps['Find Under'] = '<C-m>'
|
||||
]])
|
||||
end
|
||||
},
|
||||
|
||||
-- mics visuals
|
||||
{
|
||||
"HiPhish/nvim-ts-rainbow2",
|
||||
},
|
||||
-- {
|
||||
-- "HiPhish/nvim-ts-rainbow2",
|
||||
-- },
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
opts = {
|
||||
|
@ -299,6 +302,11 @@ return {
|
|||
},
|
||||
|
||||
-- lenguage specific
|
||||
-- just
|
||||
{
|
||||
"IndianBoy42/tree-sitter-just",
|
||||
opts = {}
|
||||
},
|
||||
-- swift
|
||||
{
|
||||
"apple/swift",
|
||||
|
@ -410,4 +418,18 @@ return {
|
|||
}
|
||||
end
|
||||
},
|
||||
{
|
||||
"loctvl842/monokai-pro.nvim",
|
||||
opts = {
|
||||
transparent_background = false,
|
||||
terminal_colors = false,
|
||||
filter = "spectrum",
|
||||
background_clear = {
|
||||
"toggleterm",
|
||||
"telescope",
|
||||
"which-key",
|
||||
"neo-tree"
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -19,6 +19,6 @@ require("lazy").setup("config.packages", {
|
|||
lazy = false
|
||||
},
|
||||
install = {
|
||||
colorscheme = { "carbonfox" },
|
||||
colorscheme = { "monokai-pro" },
|
||||
}
|
||||
})
|
||||
|
|
|
@ -5,9 +5,10 @@ vim.opt.relativenumber = true
|
|||
|
||||
-- tab && indent
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.softtabstop = 0
|
||||
--vim.opt.noexpandtab = true
|
||||
vim.cmd("set expandtab")
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.smartindent = true
|
||||
vim.o.breakindent = true
|
||||
|
||||
|
@ -31,7 +32,7 @@ vim.o.smartcase = true
|
|||
|
||||
-- colors
|
||||
vim.opt.termguicolors = true
|
||||
vim.cmd("colorscheme carbonfox")
|
||||
vim.cmd("colorscheme monokai-pro")
|
||||
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.cursorcolumn = true
|
||||
|
@ -52,3 +53,5 @@ vim.o.mouse = "a"
|
|||
vim.opt.showmode = false
|
||||
|
||||
vim.o.completeopt = "menuone,noselect"
|
||||
|
||||
vim.filetype.add({extension = {leaf = 'html'}})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue