Add files via upload
startify, nvimtree and additional keymaps added, easy to manage. main init.lua is untouched
This commit is contained in:
parent
cf0369f046
commit
f35ebcfad8
|
@ -0,0 +1,36 @@
|
|||
-- mgua: here are my additional keymaps
|
||||
|
||||
-- .o. / .wo. ecc are the "scopes"
|
||||
-- .o. is the general settings
|
||||
-- .wo. are the windows scoped options
|
||||
-- .bo. are the buffer scope
|
||||
-- see https://vonheikemen.github.io/devlog/tools/configuring-neovim-using-lua/
|
||||
vim.cmd [[
|
||||
set cc=90 " column where to put vertical bar
|
||||
set shiftwidth=4
|
||||
set tabstop=4
|
||||
set scrolloff=4 " never allow curson closer than 4 lines from upper/bottom borders
|
||||
set encoding=UTF-8 " default encoding
|
||||
set nowrap!
|
||||
set list
|
||||
"next two lines are the same: in unicode and in equivalente representations
|
||||
"set listchars=eol:⏎,tab:▸·,trail:·,space:·,nbsp:⎵ " center dot: alt-250
|
||||
"set listchars=eol:\\u23ce,tab:\\u25b8\\u2500,trail:\\u00b7,space:\\u00b7,nbsp:\\u23b5
|
||||
"let g:python3_host_prog='~/venv_nvim/bin/python' " linux
|
||||
let g:python3_host_prog='c:\Users\mgua0\venv_nvim\Scripts\python.exe' " windows
|
||||
|
||||
]]
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.listchars = { eol = '↲', tab = '▸-', trail = '·', space = '·', nbsp = '_' }
|
||||
--vim.opt.listchars = {eol = '\\u23ce', tab = '\\u25b8\\u2500', trail = '\\u00b7', space = '\\u00b7', nbsp = '\\u23b5'}
|
||||
|
||||
-- i want to make <leader>tt to toggle nvtree
|
||||
vim.keymap.set("n", "<leader>tt", ":NvimTreeToggle<Enter>")
|
||||
-- vim.keymap.set("n", "<leader>r", ":%s/<C-r><C-w>//g<Left><Left>")
|
||||
vim.keymap.set("n", "<C-Left>", "<C-w>gT") -- go to previous tab
|
||||
vim.keymap.set("n", "<C-Right>", "<C-w>gt") -- go to next tab
|
||||
vim.keymap.set("n", "<C-Up>", ":bprev<CR>") -- change current tab to previous buffer
|
||||
vim.keymap.set("n", "<C-Down>", ":bnext<CR>") -- change current tab to next buffer
|
||||
|
||||
return {}
|
|
@ -0,0 +1,12 @@
|
|||
-- modern alternative to startify
|
||||
-- this loader does not work
|
||||
|
||||
return {
|
||||
'goolord/alpha-nvim',
|
||||
requires = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function ()
|
||||
require'alpha'.setup(require'alpha.themes.startify'.config)
|
||||
end,
|
||||
}
|
||||
|
||||
return {}
|
|
@ -0,0 +1,14 @@
|
|||
-- this is from https://github.com/nvim-tree/nvim-tree.lua
|
||||
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-tree").setup {}
|
||||
--require("nvim-web-devicons").setup {}
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
-- this is from https://github.com/nvim-tree/nvim-web-devicons
|
||||
-- required for nvim-tree
|
||||
|
||||
return {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("nvim-web-devicons").setup {
|
||||
-- your personnal icons can go here (to override)
|
||||
-- you can specify color or cterm_color instead of specifying both of them
|
||||
-- DevIcon will be appended to `name`
|
||||
override = {
|
||||
zsh = {
|
||||
icon = "",
|
||||
color = "#428850",
|
||||
cterm_color = "65",
|
||||
name = "Zsh"
|
||||
}
|
||||
};
|
||||
-- globally enable different highlight colors per icon (default to true)
|
||||
-- if set to false all icons will have the default icon's color
|
||||
color_icons = true;
|
||||
-- globally enable default icons (default to false)
|
||||
-- will get overriden by `get_icons` option
|
||||
default = true;
|
||||
-- globally enable "strict" selection of icons - icon will be looked up in
|
||||
-- different tables, first by filename, and if not found by extension; this
|
||||
-- prevents cases when file doesn't have any extension but still gets some icon
|
||||
-- because its name happened to match some extension (default to false)
|
||||
strict = true;
|
||||
-- same as `override` but specifically for overrides by filename
|
||||
-- takes effect when `strict` is true
|
||||
override_by_filename = {
|
||||
[".gitignore"] = {
|
||||
icon = "",
|
||||
color = "#f1502f",
|
||||
name = "Gitignore"
|
||||
}
|
||||
};
|
||||
-- same as `override` but specifically for overrides by extension
|
||||
-- takes effect when `strict` is true
|
||||
override_by_extension = {
|
||||
["log"] = {
|
||||
icon = "",
|
||||
color = "#81e043",
|
||||
name = "Log"
|
||||
}
|
||||
};
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
-- the classical startify
|
||||
return {
|
||||
'mhinz/vim-startify'
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
-- this is for support of clipboard across remote ssh
|
||||
-- I need to bring it to lua
|
||||
--
|
||||
-- This does not have prerequirements on windows. It works if you use windows terminal
|
||||
-- and works across ssh sessions. does not currently (apr 2023) work with mremote nor putty
|
||||
--
|
||||
--
|
||||
|
||||
-- Plug 'ojroques/vim-oscyank', {'branch': 'main'} " enables Clipboard across SSH mgua 8 apr 2023
|
||||
-- " OSC52 compatibility is required in ssh terminal and in tmux if used
|
||||
-- " see https://github.com/ojroques/vim-oscyank
|
||||
--
|
||||
|
||||
" the next settings are for OSCYank (see :h oscyank-config) ----------------
|
||||
" to copy the line <leader>cc
|
||||
" to copy all: ggVG<leader>c (ggVG selects everything in visual mode)
|
||||
" leader-c yanks visually selected
|
||||
"
|
||||
lua << EOFOSCYANK
|
||||
-- keymapping defined in lua mode
|
||||
vim.keymap.set('n', '<leader>c', '<Plug>OSCYankOperator')
|
||||
vim.keymap.set('n', '<leader>cc', '<leader>c_', {remap = true})
|
||||
vim.keymap.set('v', '<leader>c', '<Plug>OSCYankVisual')
|
||||
EOFOSCYANK
|
||||
let g:oscyank_max_length = 0 " maximum length of a selection
|
||||
let g:oscyank_silent = 0 " disable message on successful copy
|
||||
let g:oscyank_trim = 1 " trim surrounding whitespaces before copy
|
||||
let g:oscyank_osc52 = "\x1b]52;c;%s\x07" " the OSC52 format string to use
|
||||
"The following commands are also available:
|
||||
" :OSCYank(text): copy text text
|
||||
" :OSCYankRegister(register): copy text from register register
|
||||
"For instance, to automatically copy text that was yanked into register +:
|
||||
autocmd TextYankPost *
|
||||
\ if v:event.operator is 'y' && v:event.regname is '+' |
|
||||
\ execute 'OSCYankRegister +' |
|
||||
\ endif
|
||||
"OSCYank cfg end -----------------------------------------------------------
|
||||
"
|
Loading…
Reference in New Issue