Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
local function map(m, k, v) vim.keymap.set(m, k, v, { silent = true }) end local o = vim.opt --fix indenting with F6 local function indent() vim.g.tabstop = 2 vim.g.shiftwidth = 2 local line = vim.api.nvim_win_get_cursor(0) vim.cmd[[ normal gg=G ]] vim.api.nvim_win_set_cursor(0,line) end map("n","
", indent) --remember the last line you where on in a while at open vim.cmd[[ if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif ]] --quit commands vim.cmd[[ command! Wq :wq command! W :w command! Q :q :cmap Q! q! :cmap q1 q! ]] --run template search map("i", "
", "
:read !$HOME/.vim/vim_templates.sh
mqgg=G'qzzi") --load templates map("n", "
html", ":-1read $HOME/.vim/skeleton/html/index.html
3j2f
bash", ":-1read $HOME/.vim/skeleton/sh/bash_header.sh
Gi") --show relative line number vim.o.relativenumber = true --load default templates on new files vim.cmd[[autocmd BufNewFile *.html 0r ~/.vim/skeleton/html/index.html]] vim.cmd[[autocmd BufNewFile *.sh 0r ~/.vim/skeleton/sh/bash_header.sh]] --local x = require('telescope.builtin').find_files(require('telescope.actions.state').get_selected_entry()) --print(x) o.expandtab = true o.tabstop=2 o.shiftwidth=2 o.hlsearch = true o.incsearch = true o.scrolloff = 10 --move selected lines up and down when in Visual Mode map("v","J",":m '>+1
gv=gv") map("v","K",":m '<-2
gv=gv") --keep cursor centered while searching map("n","n","nzzzv") map("n","N","Nzzzv") --yank/copy into system clipboard map("v", "
y", "\"+y") map("n", "
y", "\"+y") --replace every instance of current word map("n", "
s", [[:%s/\<
\>/
/gI
]]) --make current file executable map("n", "
x", "
!chmod +x %
") map('n', '
fs', '
lua require("telescope.builtin").find_files()
', opts) map('n', '
ff', '
lua require("telescope.builtin").find_files()
', opts)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)