Skip to content

Commit e3cb32d

Browse files
committed
added vim_minimal config, for server nvim setups.
1 parent 75f236e commit e3cb32d

File tree

3 files changed

+91
-1
lines changed

3 files changed

+91
-1
lines changed

ssh-agent-systemd/.config/systemd/user/ssh-agent.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Description=SSH key agent
44
[Service]
55
Type=simple
66
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
7-
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
7+
ExecStart=-/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
88

99
[Install]
1010
WantedBy=default.target
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"TODO: port to LUA!
2+
function! Minimal_foldtext()
3+
let lines_count = v:foldend - v:foldstart + 1
4+
let lines_count_text = '+' . v:folddashes . '| ' . printf("%10S" , lines_count) . ' lines |'
5+
let line_level_text = '| ' . printf("%8S" , 'level ' . v:foldlevel) . ' |'
6+
let fold_text_end = line_level_text . repeat('-',8)
7+
let fold_text_length = strlen(lines_count_text . fold_text_end) + &foldcolumn
8+
return lines_count_text . repeat('-' , winwidth(0) - fold_text_length - 4) . fold_text_end
9+
endfunction

vim_minimal/.config/nvim/init.lua

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
--set some aliases to make typing this faster.
2+
local cmd = vim.cmd
3+
local opt = vim.opt
4+
local fn = vim.fn
5+
local map = vim.api.nvim_set_keymap
6+
7+
--leader key is set through a variable, for some reason.
8+
vim.g.mapleader = ';'
9+
10+
--helper functions
11+
local function keyCode(string)
12+
return vim.api.nvim_replace_termcodes(str, true, true, true, true)
13+
end
14+
15+
--options using vim.opt (aliased, of course.)
16+
opt.mouse = 'a'
17+
opt.lazyredraw = true
18+
opt.termguicolors = true
19+
opt.autoread = true
20+
opt.swapfile = false
21+
opt.history = 500
22+
opt.formatoptions = 'rojq'
23+
--disable hard text wrapping, will only wrap visually.
24+
opt.textwidth = 0
25+
opt.wrapmargin = 0
26+
opt.wrap = true
27+
opt.linebreak = true
28+
opt.breakindent = true
29+
--add ruler to side of screen.
30+
opt.number = true
31+
opt.numberwidth=2
32+
--displays cordinates of your cursor in statusbar
33+
opt.ruler = true
34+
--always leave 5 cells between cursor and side of window.
35+
opt.scrolloff = 5
36+
--better command line completion
37+
opt.wildmenu = true
38+
--ignore case in search if search is all lowercase.
39+
opt.ignorecase = true
40+
opt.smartcase = true
41+
--show unfinished commands in statusbar.
42+
opt.showcmd = true
43+
--regex stuff
44+
opt.magic = true
45+
--always have a status line
46+
opt.laststatus = 2
47+
--tab stuff
48+
opt.tabstop = 4
49+
opt.shiftwidth = 0 --zero inherrits tabstop.
50+
opt.autoindent = true
51+
opt.smartindent = true
52+
opt.smarttab = true
53+
--space based tabs.
54+
-- opt.softtabstop=-1 --negative value inherrits shiftwidth.
55+
-- opt.expandtab=true
56+
--highlight search results as you type.
57+
opt.hlsearch = true
58+
opt.incsearch = true
59+
--foling stuff
60+
opt.foldlevelstart = 5
61+
cmd([[source ~/.config/nvim/foldtext.vimrc]])
62+
opt.foldmethod = 'indent'
63+
opt.foldtext = 'minimal_foldtext()'
64+
opt.fillchars = 'stl:=,stlnc: ,vert:|,fold:-'
65+
opt.foldcolumn = '4'
66+
opt.foldenable = true
67+
opt.foldignore = ''
68+
69+
--keyboard mappings
70+
local opts = { noremap = true, silent = true }
71+
--toggle spell check
72+
map('n', '<leader>sp', ':setlocal spell!<CR>', opts)
73+
--use ctrl+direction to move between splits.
74+
map('n', '<C-h>', '<C-w>h', opts)
75+
map('n', '<C-j>', '<C-w>j', opts)
76+
map('n', '<C-k>', '<C-w>k', opts)
77+
map('n', '<C-l>', '<C-w>l', opts)
78+
--toggle folds with space.
79+
map('', '<Space>', 'za', opts)
80+
--clear highlighting with leader+h
81+
map('', '<leader>h', ':nohls<CR>', opts)

0 commit comments

Comments
 (0)