Compare commits
3 Commits
52d9a2773d
...
5e56166650
Author | SHA1 | Date | |
---|---|---|---|
5e56166650 | |||
4225603852 | |||
6e4ee2efd2 |
@ -133,10 +133,11 @@ vim.opt.expandtab = true
|
|||||||
vim.opt.tabstop = 4
|
vim.opt.tabstop = 4
|
||||||
vim.opt.softtabstop = 4
|
vim.opt.softtabstop = 4
|
||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.opt.colorcolumn = '120'
|
|
||||||
|
|
||||||
-- Make line numbers default
|
-- Make line numbers default
|
||||||
vim.wo.number = true
|
vim.wo.number = true
|
||||||
|
vim.opt.colorcolumn = '120'
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
|
||||||
-- Enable mouse mode
|
-- Enable mouse mode
|
||||||
vim.o.mouse = 'a'
|
vim.o.mouse = 'a'
|
||||||
|
@ -3,13 +3,12 @@
|
|||||||
# --------------------------------
|
# --------------------------------
|
||||||
# Shell RC
|
# Shell RC
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;41m\]$(hostname)\[\033[00m\]\[\033[01;34m\] \w\[\033[00m\] \$ '
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;41m\]$(hostname)\[\033[00m\]\[\033[01;34m\] \w\[\033[00m\] \$ '
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\e[1;31m$(hostname) \e[0m\e[1;94m\w\e[0m\e[0;35m $(__git_ps1 " %s")\e[0m \e[1;31m \e[0m'
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Variables
|
# Variables
|
||||||
#
|
#
|
||||||
export EDITOR=vim
|
export EDITOR=nvim
|
||||||
export PATH=~/bin:$PATH
|
export PATH=~/bin:$PATH
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -20,6 +19,7 @@ alias q=exit
|
|||||||
alias a=clear
|
alias a=clear
|
||||||
alias h=history
|
alias h=history
|
||||||
alias e=$EDITOR
|
alias e=$EDITOR
|
||||||
|
alias n=nvim
|
||||||
|
|
||||||
#
|
#
|
||||||
# Functions
|
# Functions
|
||||||
|
94
root.init.lua
Normal file
94
root.init.lua
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
-- [[ Setting options ]]
|
||||||
|
-- See `:help vim.o`
|
||||||
|
|
||||||
|
-- Set highlight on search
|
||||||
|
vim.o.hlsearch = true
|
||||||
|
|
||||||
|
-- Highlight problematic whitespace
|
||||||
|
vim.o.list = true
|
||||||
|
vim.opt.listchars = { tab = '▶ ', trail = '●', extends = '#', nbsp = '.' }
|
||||||
|
|
||||||
|
-- Whitespace/tab management
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.softtabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
|
||||||
|
-- Make line numbers default
|
||||||
|
vim.wo.number = true
|
||||||
|
vim.opt.colorcolumn = '120'
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
|
||||||
|
-- Enable mouse mode
|
||||||
|
vim.o.mouse = 'a'
|
||||||
|
|
||||||
|
-- Enable break indent
|
||||||
|
vim.o.breakindent = true
|
||||||
|
vim.o.wrap = false
|
||||||
|
|
||||||
|
-- Save undo history
|
||||||
|
vim.o.undofile = true
|
||||||
|
|
||||||
|
-- Case insensitive searching UNLESS /C or capital in search
|
||||||
|
vim.o.ignorecase = true
|
||||||
|
vim.o.smartcase = true
|
||||||
|
|
||||||
|
-- Decrease update time
|
||||||
|
vim.o.updatetime = 250
|
||||||
|
vim.wo.signcolumn = 'yes'
|
||||||
|
|
||||||
|
-- Set colorscheme
|
||||||
|
vim.o.termguicolors = true
|
||||||
|
-- vim.cmd [[colorscheme molokini]]
|
||||||
|
-- vim.cmd.colorscheme('molokini')
|
||||||
|
vim.cmd.colorscheme('habamax')
|
||||||
|
|
||||||
|
-- Set completeopt to have a better completion experience
|
||||||
|
vim.o.completeopt = 'menuone,noselect'
|
||||||
|
|
||||||
|
-- Do not auto read file when in focus
|
||||||
|
vim.o.autoread = false
|
||||||
|
|
||||||
|
-- [[ Basic Keymaps ]]
|
||||||
|
-- Set <space> as the leader key
|
||||||
|
-- See `:help mapleader`
|
||||||
|
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
|
||||||
|
vim.g.mapleader = ','
|
||||||
|
vim.g.maplocalleader = ','
|
||||||
|
|
||||||
|
-- Keymaps for better default experience
|
||||||
|
-- See `:help vim.keymap.set()`
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||||
|
|
||||||
|
-- Remap for dealing with word wrap
|
||||||
|
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
|
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-t>', ':Explore<CR>', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-z>', ':bn<CR>', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('v', '<c-z>', ':bn<CR>', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-x>', ':bp<CR>', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('n', '<F5>', ':e<CR>', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('n', '<F6>', '<C-W>w', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('n', '<F18>', '<C-W>W', { noremap = 1 }) -- S-F6 (F18 defined in ST's config.h)
|
||||||
|
vim.api.nvim_set_keymap('n', '<F7>', '<C-W>o', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('n', '<F8>', '<C-W>v', { noremap = 1 })
|
||||||
|
vim.api.nvim_set_keymap('n', '<F20>', '<C-W>s', { noremap = 1 }) -- S-F8 (F20 defined in ST's config.h)
|
||||||
|
vim.api.nvim_set_keymap('n', '<F35>', ':confirm bd<CR>', { noremap = 1 }) -- C-F11 (F35 defined in ST's config.h)
|
||||||
|
vim.api.nvim_set_keymap('v', '<LeftRelease>','"*ygv', { noremap = 1 }) -- Copy selection to clipboard
|
||||||
|
vim.api.nvim_set_keymap('v', '<2-LeftRelease>','"*ygv', { noremap = 1 }) -- Copy word selection to clipboard
|
||||||
|
vim.api.nvim_set_keymap('v', '<3-LeftRelease>','"*ygv', { noremap = 1 }) -- Copy line selection to clipboard
|
||||||
|
vim.api.nvim_set_keymap('v', '<4-LeftRelease>','"*ygv', { noremap = 1 }) -- Copy column selection to clipboard
|
||||||
|
vim.api.nvim_set_keymap('v', '<c-r>', '"hy/<C-r>h<cr>', { noremap = 1 }) -- Search selected text
|
||||||
|
vim.api.nvim_set_keymap('n', '<c-Space>', 'za', { noremap = 1 }) -- Toggle fold
|
||||||
|
vim.api.nvim_set_keymap('v', '<', '<gv', { noremap = 1 }) -- Preserve selection after left indent
|
||||||
|
vim.api.nvim_set_keymap('v', '>', '>gv', { noremap = 1 }) -- Preserve selection after right indent
|
||||||
|
vim.api.nvim_set_keymap('v', 'Q', 'gqa', { noremap = 1 }) -- Reflow visually highlighted lines with Q
|
||||||
|
vim.api.nvim_set_keymap('n', 'Q', 'gq', { noremap = 1 }) -- Reflow text
|
||||||
|
|
||||||
|
-- Insert time/date stamps
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>td', 'a<C-R>=strftime(\'%Y/%m/%d\')<CR><Esc>', { noremap = 1 }) -- 'Insert [T]imestamp - [d]ate'
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>tt', 'a<C-R>=strftime(\'%Y/%m/%d %H:%M:%S\')<CR><Esc>', { noremap = 1 }) -- 'Insert [T]imestamp - date[t]ime'
|
||||||
|
|
||||||
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
|
-- vim: ft=lua ts=4 sts=4 sw=4 et
|
Loading…
Reference in New Issue
Block a user