OSC52 clipboard yanks
This commit is contained in:
@ -9,7 +9,7 @@ lsp_status.register_progress()
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "sumneko_lua", "rust_analyzer" }
|
||||
ensure_installed = { "lua_ls", "rust_analyzer" }
|
||||
})
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
@ -102,34 +102,6 @@ local runtime_path = vim.split(package.path, ";")
|
||||
table.insert(runtime_path, "lua/?.lua")
|
||||
table.insert(runtime_path, "lua/?/init.lua")
|
||||
|
||||
lspconfig.sumneko_lua.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
local lspkind = require("lspkind")
|
||||
lspkind.init()
|
||||
local cmp = require("cmp")
|
||||
|
3
vim/.vim/lua/config/oscyank.lua
Normal file
3
vim/.vim/lua/config/oscyank.lua
Normal file
@ -0,0 +1,3 @@
|
||||
local map = require("utils").map
|
||||
map("n", "<Leader>y", ":OSCYank<CR>", opts)
|
||||
map("v", "<Leader>y", ":OSCYank<CR>", opts)
|
@ -222,6 +222,10 @@ require('packer').startup(function(use)
|
||||
'tmux-plugins/vim-tmux-focus-events',
|
||||
'skywind3000/asyncrun.vim',
|
||||
}
|
||||
use {
|
||||
'ojroques/vim-oscyank',
|
||||
config = [[ require("config.oscyank") ]]
|
||||
}
|
||||
|
||||
-- mine
|
||||
use {
|
||||
|
@ -29,8 +29,8 @@ vmap <leader>v c<ESC>"+p<ESC>
|
||||
imap <leader>v <ESC>"+pa
|
||||
|
||||
" Copy to OS clipboard
|
||||
vnoremap <leader>y "yy <Bar> :call system('xclip', @y)<CR>
|
||||
map <leader>y "yy <Bar> :call system('xclip', @y)<CR>
|
||||
" vnoremap <leader>y "yy <Bar> :call system('xclip', @y)<CR>
|
||||
" map <leader>y "yy <Bar> :call system('xclip', @y)<CR>
|
||||
|
||||
" --------- WINDOW/PANE MAPPINGS ---------
|
||||
map <leader>wr <C-W>r
|
||||
@ -123,3 +123,25 @@ function! <SID>SynStack()
|
||||
endfunc
|
||||
|
||||
nnoremap <leader>s :SaveSession<CR>
|
||||
|
||||
" copy to attached terminal using the yank(1) script:
|
||||
" https://github.com/sunaku/home/blob/master/bin/yank
|
||||
function! Yank(text) abort
|
||||
let escape = system('yank', a:text)
|
||||
if v:shell_error
|
||||
echoerr escape
|
||||
else
|
||||
call writefile([escape], '/dev/tty', 'b')
|
||||
endif
|
||||
endfunction
|
||||
noremap <silent> <Leader>y y:<C-U>call Yank(@0)<CR>
|
||||
|
||||
" automatically run yank(1) whenever yanking in Vim
|
||||
" (this snippet was contributed by Larry Sanderson)
|
||||
function! CopyYank() abort
|
||||
call Yank(join(v:event.regcontents, "\n"))
|
||||
endfunction
|
||||
|
||||
" autocmd TextYankPost * call CopyYank()
|
||||
noremap <leader>y call CopyYank()
|
||||
vnoremap <leader>y call CopyYank()
|
||||
|
24
vim/.vimrc
24
vim/.vimrc
@ -60,18 +60,18 @@ set splitbelow " Puts new split windows to the bottom of the current
|
||||
set scrolljump=5 " Line to scroll when cursor leaves screen
|
||||
set scrolloff=3 " Minumum lines to keep above and below cursor
|
||||
|
||||
let g:clipboard = #{
|
||||
\ name: 'xsel',
|
||||
\ copy: {
|
||||
\ '+': ['xclip', '--nodetach', '-i', '-b'],
|
||||
\ '*': ['xclip', '--nodetach', '-i', '-p'],
|
||||
\ },
|
||||
\ paste: {
|
||||
\ '+': ['xclip', '-o', '-b'],
|
||||
\ '*': ['xclip', '-o', '-p'],
|
||||
\ },
|
||||
\ cache_enabled: 1,
|
||||
\ }
|
||||
" let g:clipboard = #{
|
||||
" \ name: 'xsel',
|
||||
" \ copy: {
|
||||
" \ '+': ['xclip', '--nodetach', '-i', '-b'],
|
||||
" \ '*': ['xclip', '--nodetach', '-i', '-p'],
|
||||
" \ },
|
||||
" \ paste: {
|
||||
" \ '+': ['xclip', '-o', '-b'],
|
||||
" \ '*': ['xclip', '-o', '-p'],
|
||||
" \ },
|
||||
" \ cache_enabled: 1,
|
||||
" \ }
|
||||
set shortmess=A
|
||||
set shortmess+=O
|
||||
set modifiable
|
||||
|
Reference in New Issue
Block a user