Compare commits

..
12 Commits
6 changed files with 83 additions and 5 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ vim.keymap.set('n','<space><tab>',':b#<CR>', {noremap=true, silent=true})
vim.keymap.set('n', '<leader>cd', ':cd %:p:h<CR>', {noremap=true, silent=true})
vim.api.nvim_set_keymap('n', '<leader>ff', '<cmd>Telescope find_files<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>fg', '<cmd>Telescope live_grep<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>fb', '<cmd>Telescope buffers<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>rg', '<cmd>Telescope live_grep<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>bb', '<cmd>Telescope buffers<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>fh', '<cmd>Telescope help_tags<cr>', {noremap = true, silent = true})
vim.keymap.set('n', '-', '/', { noremap = true, silent = true })
+1 -1
View File
@@ -9,5 +9,5 @@ vim.opt.mouse="a"
vim.opt.clipboard="unnamedplus"
vim.g.mapleader = " "
vim.g.maplocalleader = ","
vim.opt.spell = true
-- vim.opt.spell = true
vim.opt.ignorecase = true
+2
View File
@@ -6,6 +6,8 @@ return {
vim.api.nvim_set_keymap('n', '<M-s>', '<Plug>(easymotion-s2)', {})
vim.api.nvim_set_keymap('n', '<M-l>', '<Plug>(easymotion-lineanywhere)', {})
vim.api.nvim_set_keymap('n', '<M-j>', '<Plug>(easymotion-jumptoanywhere)', {})
vim.g.EasyMotion_keys = 'asdghklqwertzuiopzxcvbnmfjé'
end
},
}
+16
View File
@@ -1,8 +1,24 @@
return {
{'vimwiki/vimwiki'},
{'tpope/vim-fugitive'},
{'gorkunov/smartpairs.vim'},
{'tpope/vim-surround'},
{'echasnovski/mini.ai',
config = function()
require('mini.ai').setup()
end},
{'jiangmiao/auto-pairs'},
{'github/copilot.vim',
config = function()
vim.keymap.set('i', '<C-J>', 'copilot#Accept("\\<CR>")', { expr = true, replace_keycodes = false })
vim.keymap.set('i', '<C-L>', '<Plug>(copilot-accept-word)')
vim.keymap.set('i', '<PageDown>', '<Plug>(copilot-previous)')
vim.keymap.set('i', '<PageUp>', '<Plug>(copilot-next)')
vim.keymap.set('i', '<Home>', '<Plug>(copilot-suggest)')
vim.keymap.set('i', '<M-Left>', '<esc>dawi<Right>')
vim.g.copilot_no_tab_map=true
end
},
{'mattn/emmet-vim',
ft = { 'html', 'css', 'javascript', 'typescript', 'vue' },
}
+2 -1
View File
@@ -7,6 +7,7 @@ return {
iron.setup {
config = {
-- Whether a repl should be discarded or not
highlight_last = false,
scratch_repl = false,
-- Your repl definitions come here
repl_definition = {
@@ -22,7 +23,7 @@ return {
},
-- How the repl window will be displayed
-- See below for more information
repl_open_cmd = require('iron.view').split.below(80),
repl_open_cmd = 'belowright 20split' --require('iron.view').split.below(80),
},
-- Iron doesn't set keymaps by default anymore.
-- You can set them here or manually add keymaps to the functions in iron.core
+60 -1
View File
@@ -1,4 +1,3 @@
-- Alternatively, using a Lua function
local function lines_with_preview()
local current_file = vim.fn.fnameescape(vim.fn.expand('%'))
local rg_command = string.format("rg --with-filename --column --line-number --no-heading --color=always --smart-case . %s", current_file)
@@ -6,4 +5,64 @@ local function lines_with_preview()
vim.cmd(fzf_command)
end
function DevtoolsPath()
local devPath = vim.fn.trim(vim.fn.system('ls ' .. vim.fn.expand("%:p:h") .. ' | grep DESCRIPTION'))
if devPath == "" then
devPath = vim.fn.trim(vim.fn.system('realpath ' .. vim.fn.expand("%:p:h") .. '/../'))
return devPath
else
devPath = vim.fn.expand('%:p:h')
return devPath
end
end
vim.api.nvim_create_user_command('LinesWithPreview', lines_with_preview, {})
vim.api.nvim_create_autocmd({"BufNewFile", "BufRead"}, {
pattern = "DESCRIPTION",
command = "set filetype=r"
})
local function IronQuiteSend(opts)
-- Get the current filetype to send to the appropriate REPL
local ft = vim.bo.filetype
-- Concatenate all arguments passed to the command
local command = table.concat(opts.fargs, " ")
-- Send the command to the REPL
require('iron.core').send(ft, command)
end
-- Create the primary command in Neovim
vim.api.nvim_create_user_command('IronQuiteSend', IronQuiteSend, {
nargs = '+', -- Allows for multiple arguments
})
-- Map <C-c>wd to send devtools::document command in R
vim.api.nvim_create_autocmd("FileType", {
pattern = "r",
callback = function()
vim.api.nvim_set_keymap('n', '<C-c>wd', ':IronQuiteSend devtools::document("' .. DevtoolsPath() .. '")<CR>', { noremap = true, silent = true })
end
})
-- Map <C-c>wi to send devtools::install command in R
vim.api.nvim_create_autocmd("FileType", {
pattern = "r",
callback = function()
vim.api.nvim_set_keymap('n', '<C-c>wi', ':IronQuiteSend devtools::install("' .. DevtoolsPath() .. '", upgrade = "never")<CR>', { noremap = true, silent = true })
end
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "r",
callback = function()
vim.api.nvim_set_keymap('n', '<C-c>i', ':IronQuiteSend install.packages("")<Left><Left>', { noremap = true, silent = true })
end
})