aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-04-16 00:10:13 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-04-16 00:10:13 +0200
commitac36631668ad3b53b140c8614136c76ac2794164 (patch)
tree95104ff4a8628c64796046bffcd737651e9fb01b
parent95c1ac78f0ad88fa0c7982d18f398e33839000b8 (diff)
downloadnvim-conf-ac36631668ad3b53b140c8614136c76ac2794164.tar.gz
nvim-conf-ac36631668ad3b53b140c8614136c76ac2794164.zip
some updates
-rw-r--r--after/ftplugin/go.vim2
-rw-r--r--after/plugin/rest.lua1
-rw-r--r--lua/alpha/scratchs/draft.lua27
-rw-r--r--plugin/packer_compiled.lua8
4 files changed, 34 insertions, 4 deletions
diff --git a/after/ftplugin/go.vim b/after/ftplugin/go.vim
index 52ba3ad..a03721a 100644
--- a/after/ftplugin/go.vim
+++ b/after/ftplugin/go.vim
@@ -1 +1,3 @@
set listchars=tab:\ \ ,trail:-
+set makeprg=go\ build
+set efm=%-G%f:%l:%c:W:\ %m,%-G%f:%l::W:\ %m,%f:%l:%c:%t:\ %m,%f:%l:%c::\ %m,%f:%l::%t:\ %m
diff --git a/after/plugin/rest.lua b/after/plugin/rest.lua
index baf4edd..f9417dd 100644
--- a/after/plugin/rest.lua
+++ b/after/plugin/rest.lua
@@ -32,6 +32,7 @@ vim.api.nvim_create_autocmd("FileType", {
local buff = tonumber(vim.fn.expand("<abuf>"), 10)
vim.keymap.set("n", "<leader>rn", rest_nvim.run, { noremap = true, buffer = buff })
vim.keymap.set("n", "<leader>rl", rest_nvim.last, { noremap = true, buffer = buff })
+ vim.keymap.set("n", "<leader>rp", function () rest_nvim.run(true) end, { noremap = true, buffer = buff })
end
})
diff --git a/lua/alpha/scratchs/draft.lua b/lua/alpha/scratchs/draft.lua
index 67d0590..32b9c8d 100644
--- a/lua/alpha/scratchs/draft.lua
+++ b/lua/alpha/scratchs/draft.lua
@@ -71,3 +71,30 @@ function Queries()
P(node:end_())
end
end
+
+local function get_visual_selection()
+ local s_start = vim.fn.getpos("'<")
+ local s_end = vim.fn.getpos("'>")
+ local n_lines = math.abs(s_end[2] - s_start[2]) + 1
+ local lines = vim.api.nvim_buf_get_lines(0, s_start[2] - 1, s_end[2], false)
+ lines[1] = string.sub(lines[1], s_start[3], -1)
+ if n_lines == 1 then
+ lines[n_lines] = string.sub(lines[n_lines], 1, s_end[3] - s_start[3] + 1)
+ else
+ lines[n_lines] = string.sub(lines[n_lines], 1, s_end[3])
+ end
+ return table.concat(lines, '\n')
+end
+
+function GetPhpString()
+ local s_start = vim.fn.getpos("'<")
+ local s_end = vim.fn.getpos("'>")
+ local text = get_visual_selection()
+ P(text)
+ local result = vim.fn.system("php -r 'echo \"" .. text .. "\";'")
+ vim.api.nvim_put({result}, "", true, false)
+ P(result)
+ vim.api.nvim_buf_set_text(0, s_start[2] -1 , s_start[3] -1, s_end[2] -1, s_end[3], {result})
+end
+
+vim.keymap.set('n', '<leader>rrh', GetPhpString, {})
diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua
index f3e7c3b..8900484 100644
--- a/plugin/packer_compiled.lua
+++ b/plugin/packer_compiled.lua
@@ -439,14 +439,14 @@ time([[Defining packer_plugins]], false)
time([[Config for git-worktree.nvim]], true)
try_loadstring("\27LJ\2\n>\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\17git-worktree\frequire\0", "config", "git-worktree.nvim")
time([[Config for git-worktree.nvim]], false)
--- Config for: nvim-projectconfig
-time([[Config for nvim-projectconfig]], true)
-try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23nvim-projectconfig\frequire\0", "config", "nvim-projectconfig")
-time([[Config for nvim-projectconfig]], false)
-- Config for: nvim-colorizer.lua
time([[Config for nvim-colorizer.lua]], true)
try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14colorizer\frequire\0", "config", "nvim-colorizer.lua")
time([[Config for nvim-colorizer.lua]], false)
+-- Config for: nvim-projectconfig
+time([[Config for nvim-projectconfig]], true)
+try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23nvim-projectconfig\frequire\0", "config", "nvim-projectconfig")
+time([[Config for nvim-projectconfig]], false)
-- Command lazy-loads
time([[Defining lazy-load commands]], true)