neovim: stash changes before hard reset
This commit is contained in:
parent
38c03be3f4
commit
012ac14dce
|
@ -42,9 +42,12 @@ Plug 'simrat39/rust-tools.nvim'
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
|
|
||||||
" src tree view
|
" src tree view
|
||||||
Plug 'preservim/nerdtree'
|
Plug 'nvim-tree/nvim-tree.lua'
|
||||||
|
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
" lua require("setup"
|
||||||
|
luafile ~/.config/nvim/lua/setup.lua
|
||||||
|
|
||||||
|
|
||||||
" ==============================================================================
|
" ==============================================================================
|
||||||
|
@ -53,6 +56,7 @@ call plug#end()
|
||||||
" dealing with files
|
" dealing with files
|
||||||
syntax on
|
syntax on
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
set paste
|
||||||
set colorcolumn=80
|
set colorcolumn=80
|
||||||
set autoindent expandtab tabstop=4 shiftwidth=4
|
set autoindent expandtab tabstop=4 shiftwidth=4
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
|
@ -232,12 +236,10 @@ nnoremap <C-K> <C-W><C-K>
|
||||||
nnoremap <C-L> <C-W><C-L>
|
nnoremap <C-L> <C-W><C-L>
|
||||||
nnoremap <C-H> <C-W><C-H>
|
nnoremap <C-H> <C-W><C-H>
|
||||||
|
|
||||||
"enable nerdtree with ^\
|
" neovide (GUI) clipboard
|
||||||
map <C-Bslash> :NERDTreeToggle<CR>
|
nnoremap <C-S-V> "+P
|
||||||
|
" handle Ctrl+Shift+V in GUI somehow
|
||||||
" enable clipboard access for Neovide
|
" inoremap <C-S-V> "+P
|
||||||
nnoremap <D-V> "+p
|
|
||||||
nnoremap <C-S-V> "+p
|
|
||||||
|
|
||||||
|
|
||||||
" RUST
|
" RUST
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- initial setup
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- disable netrw at the very start of init.lua (strongly advised by _nvim-tree.lua_)
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Plugin setup
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- ensure that packer is installed
|
||||||
|
if vim.fn.empty(vim.fn.glob(vim.fn.stdpath("data").."/site/pack/packer/start/packer.nvim")) > 0 then
|
||||||
|
PACKER_BOOTSTRAP = vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--depth",
|
||||||
|
"1",
|
||||||
|
"https://github.com/wbthomason/packer.nvim",
|
||||||
|
"~/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||||
|
})
|
||||||
|
print("Packer installed. Please close and re-open Neovim.");
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Autocommand that reloads Neovim whenever the "plugins.lua" file is saved
|
||||||
|
|
||||||
|
|
||||||
|
-- 'nvim-tree.lua' setup
|
||||||
|
require("nvim-tree").setup({
|
||||||
|
auto_reload_on_write = true,
|
||||||
|
disable_netrw = false,
|
||||||
|
hijack_netrw = true,
|
||||||
|
sort_by = "case_sensitive",
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
number = true,
|
||||||
|
relativenumber = true,
|
||||||
|
mappings = {
|
||||||
|
list = {
|
||||||
|
{ key = "u", action = "dir_up" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
group_empty = false,
|
||||||
|
highlight_git = true,
|
||||||
|
icons = {
|
||||||
|
symlink_arrow = " ➛ ",
|
||||||
|
glyphs = {
|
||||||
|
modified = "●",
|
||||||
|
git = {
|
||||||
|
unstaged = "✗",
|
||||||
|
staged = "✓",
|
||||||
|
unmerged = "",
|
||||||
|
renamed = "➜",
|
||||||
|
untracked = "[ ]",
|
||||||
|
deleted = "",
|
||||||
|
ignored = "◌",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
special_files = { "Cargo.toml", "README.md", "Readme.md", "readme.md" },
|
||||||
|
symlink_destination = true,
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- open _things_...
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local function open_nvim_tree()
|
||||||
|
require("nvim-tree.api").tree.open()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- UNDO THIS open_nvim_tree()
|
|
@ -0,0 +1,67 @@
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- initial setup
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- disable netrw at the very start of init.lua (strongly advised by _nvim-tree.lua_)
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Plugin setup
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- 'nvim-tree.lua' setup
|
||||||
|
require("nvim-tree").setup({
|
||||||
|
auto_reload_on_write = true,
|
||||||
|
disable_netrw = false,
|
||||||
|
hijack_netrw = true,
|
||||||
|
sort_by = "case_sensitive",
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
number = true,
|
||||||
|
relativenumber = true,
|
||||||
|
mappings = {
|
||||||
|
list = {
|
||||||
|
{ key = "u", action = "dir_up" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
group_empty = false,
|
||||||
|
highlight_git = true,
|
||||||
|
icons = {
|
||||||
|
symlink_arrow = " ➛ ",
|
||||||
|
glyphs = {
|
||||||
|
modified = "●",
|
||||||
|
git = {
|
||||||
|
unstaged = "✗",
|
||||||
|
staged = "✓",
|
||||||
|
unmerged = "",
|
||||||
|
renamed = "➜",
|
||||||
|
untracked = "[ ]",
|
||||||
|
deleted = "",
|
||||||
|
ignored = "◌",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
special_files = { "Cargo.toml", "README.md", "Readme.md", "readme.md" },
|
||||||
|
symlink_destination = true,
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- open _things_...
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local function open_nvim_tree()
|
||||||
|
require("nvim-tree.api").tree.open()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- UNDO THIS open_nvim_tree()
|
Loading…
Reference in New Issue