mirror of
https://github.com/harish2704/dotFiles.git
synced 2026-09-10 15:21:09 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e6e0a997d | ||
|
|
9b816966a2 | ||
|
|
fd261114a0 | ||
|
|
9b74ed3e95 | ||
|
|
a5871c48e4 | ||
|
|
fb309b33fc |
@@ -61,6 +61,9 @@ au BufEnter *.sshconf set ft=sshconfig
|
||||
autocmd VimEnter *.py SyntasticToggleMode
|
||||
|
||||
|
||||
" Disable sytax for big files
|
||||
" autocmd BufWinEnter * if line2byte(line("$") + 1) > 10000 | set ft=text | let b:deoplete_disable_auto_complete = 1 | endif
|
||||
" autocmd BufEnter * if getfsize(expand("%")) > 10000 | set ft=text | endif
|
||||
|
||||
" Syntax based folding found be slow. In most of the cases, we will do indenting according to syntax.
|
||||
autocmd FileType java set foldmethod=indent
|
||||
|
||||
@@ -38,6 +38,11 @@ ocr(){
|
||||
http-server -o
|
||||
}
|
||||
|
||||
# resize pdf <input> <output>
|
||||
resizePdf(){
|
||||
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dDownsampleColorImages=true -dColorImageResolution=94 -dNOPAUSE -dBATCH -sOutputFile="$2" "$1"
|
||||
}
|
||||
|
||||
# Open many ssh sessions in separate tabs in gnome-terminal
|
||||
sshInTabs(){
|
||||
logins="$@"
|
||||
@@ -297,6 +302,17 @@ swaysleep(){
|
||||
swaylock & systemctl suspend
|
||||
}
|
||||
|
||||
# Start php with xdebug
|
||||
phpdebugsrv(){
|
||||
php -S 127.0.0.1:8000 -d xdebug.mode=develop,debug -d xdebug.start_with_request=yes $@
|
||||
}
|
||||
|
||||
|
||||
# Run any application with ibus support
|
||||
ibusRun(){
|
||||
env GTK_IM_MODULE=ibus QT_IM_MODULE=ibus XMODIFIERS=@im=ibus $@
|
||||
}
|
||||
|
||||
|
||||
# Setup autocomplete. run eval "$(THIS_FILE setup-autocomplete)"
|
||||
setup-autocomplete(){
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
./html-editor-grapejs.sh
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
THIS_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
cd $THIS_DIR
|
||||
|
||||
python -m http.server 8082
|
||||
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>html editor</title>
|
||||
<script type="text/javascript" src="https://unpkg.com/grapesjs"></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="https://unpkg.com/grapesjs-blocks-basic"
|
||||
></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="https://unpkg.com/grapesjs/dist/css/grapes.min.css"
|
||||
/>
|
||||
|
||||
<style type="text/css" media="screen">
|
||||
body,
|
||||
html {
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="gjs">
|
||||
<div class="col col-md-12">
|
||||
<h2>Welcome</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" >
|
||||
const editor = grapesjs.init({
|
||||
container: "#gjs",
|
||||
fromElement: 1,
|
||||
height: "100%",
|
||||
storageManager: false,
|
||||
plugins: ["gjs-blocks-basic"],
|
||||
avoidInlineStyle: 1,
|
||||
});
|
||||
|
||||
editor.getModel().set("dmode", "absolute");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,4 @@
|
||||
@page{
|
||||
size: A3;
|
||||
margin: 0mm 0mm 0mm 0mm;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
./lvim.sh
|
||||
./nvim-distro.sh
|
||||
@@ -0,0 +1,218 @@
|
||||
--[[
|
||||
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
|
||||
`lvim` is the global options object
|
||||
]]
|
||||
-- vim options
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- general
|
||||
lvim.log.level = "info"
|
||||
lvim.format_on_save = {
|
||||
enabled = true,
|
||||
pattern = "*.lua",
|
||||
timeout = 1000,
|
||||
}
|
||||
-- to disable icons and use a minimalist setup, uncomment the following
|
||||
-- lvim.use_icons = false
|
||||
|
||||
-- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
|
||||
lvim.leader = "space"
|
||||
-- add your own keymapping
|
||||
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
||||
|
||||
-- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
|
||||
-- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
|
||||
|
||||
-- -- Use which-key to add extra bindings with the leader-key prefix
|
||||
-- lvim.builtin.which_key.mappings["W"] = { "<cmd>noautocmd w<cr>", "Save without formatting" }
|
||||
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
|
||||
|
||||
-- -- Change theme settings
|
||||
-- lvim.colorscheme = "lunar"
|
||||
|
||||
lvim.builtin.alpha.active = true
|
||||
lvim.builtin.alpha.mode = "dashboard"
|
||||
lvim.builtin.terminal.active = true
|
||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
||||
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
lvim.builtin.treesitter.auto_install = true
|
||||
|
||||
-- lvim.builtin.treesitter.ignore_install = { "haskell" }
|
||||
|
||||
-- -- always installed on startup, useful for parsers without a strict filetype
|
||||
-- lvim.builtin.treesitter.ensure_installed = { "comment", "markdown_inline", "regex" }
|
||||
|
||||
-- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support>
|
||||
|
||||
-- --- disable automatic installation of servers
|
||||
-- lvim.lsp.installer.setup.automatic_installation = false
|
||||
|
||||
-- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
|
||||
-- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
|
||||
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
|
||||
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
|
||||
-- require("lvim.lsp.manager").setup("pyright", opts)
|
||||
|
||||
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
|
||||
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
|
||||
-- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
|
||||
-- return server ~= "emmet_ls"
|
||||
-- end, lvim.lsp.automatic_configuration.skipped_servers)
|
||||
|
||||
-- -- you can set a custom on_attach function that will be used for all the language servers
|
||||
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
|
||||
-- lvim.lsp.on_attach_callback = function(client, bufnr)
|
||||
-- local function buf_set_option(...)
|
||||
-- vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
-- end
|
||||
-- --Enable completion triggered by <c-x><c-o>
|
||||
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
-- end
|
||||
|
||||
-- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting>
|
||||
-- local formatters = require "lvim.lsp.null-ls.formatters"
|
||||
-- formatters.setup {
|
||||
-- { command = "stylua" },
|
||||
-- {
|
||||
-- command = "prettier",
|
||||
-- extra_args = { "--print-width", "100" },
|
||||
-- filetypes = { "typescript", "typescriptreact" },
|
||||
-- },
|
||||
-- }
|
||||
-- local linters = require "lvim.lsp.null-ls.linters"
|
||||
-- linters.setup {
|
||||
-- { command = "flake8", filetypes = { "python" } },
|
||||
-- {
|
||||
-- command = "shellcheck",
|
||||
-- args = { "--severity", "warning" },
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- -- Additional Plugins <https://www.lunarvim.org/docs/plugins#user-plugins>
|
||||
-- lvim.plugins = {
|
||||
-- {
|
||||
-- "folke/trouble.nvim",
|
||||
-- cmd = "TroubleToggle",
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
|
||||
-- vim.api.nvim_create_autocmd("FileType", {
|
||||
-- pattern = "zsh",
|
||||
-- callback = function()
|
||||
-- -- let treesitter use bash highlight for zsh files as well
|
||||
-- require("nvim-treesitter.highlight").attach(0, "bash")
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
|
||||
vim.cmd([[
|
||||
command! -nargs=+ Gr :silent execute 'grep! -nr "<args>" | copen'
|
||||
" Raw version of Gr command.
|
||||
command! -nargs=* Grc grep -nr <args>
|
||||
|
||||
" Add file header to current buffer. Depends on https://github.com/harish2704/file-header
|
||||
command! Header :execute '0r!file-header %'
|
||||
|
||||
" Open Terminal in split window
|
||||
command! Termw :execute '!konsole -e bash-session &'
|
||||
command! Term :execute 'sp | term'
|
||||
|
||||
" Cd to current file's directory
|
||||
command! Cwd :execute 'cd %:p:h'
|
||||
|
||||
" Cd to current file's directory, but limit to current tab
|
||||
command! Tcd :execute ':tcd %:p:h'
|
||||
|
||||
" Reload current buffer
|
||||
command! Reload :execute "bufdo execute 'checktime . bufnr('%')'"
|
||||
|
||||
" Delete current file and close buffer
|
||||
command! Rm :execute '!rm %' | bd
|
||||
|
||||
" Copy current file path to unnamedplus register
|
||||
command! CopyFilename :let @+=@%
|
||||
|
||||
" Open vscode in on current line
|
||||
command! Code :execute "!code ./ -g %:". ( line('.')+1 )
|
||||
|
||||
" For Open a terminal in current directory
|
||||
nmap <Leader><Leader>t :!xdg-terminal&<CR>
|
||||
" Open git-gui in current pwd
|
||||
nmap <Leader><Leader>g :!git gui &<CR>
|
||||
|
||||
" <Alt-R> -> Reload current file
|
||||
nmap <M-r> :e!<CR>
|
||||
|
||||
" Alt-q Delete current buffer ( Close file )
|
||||
nmap <M-q> :bd<CR>
|
||||
|
||||
" <Ctrl-Shift-q> force Close buffer
|
||||
nmap <M-Q> :bd!<CR>
|
||||
|
||||
" Select a word and press Ctrl-h to replace all its occurance, even if the word is having special chars
|
||||
vmap <C-h> "fy:%s#<C-r>f#
|
||||
" Copy current word to 'f' register, search for that word
|
||||
vmap <C-f> "fy/<C-r>f
|
||||
|
||||
" Ctrl-Enter in insert mode will append ';' to the line and insert a new line
|
||||
imap <C-CR> <ESC>A;
|
||||
|
||||
" Alt + Arrows to Moving cursor to different windows {{{
|
||||
nmap <M-Up> <C-W>k
|
||||
nmap <M-Down> <C-W>j
|
||||
nmap <M-Right> <C-W>l
|
||||
nmap <M-Left> <C-W>h
|
||||
" }}}
|
||||
|
||||
" For terminal mod {{{
|
||||
tmap <C-PageUp> <C-\><C-n><C-PageUp>
|
||||
tmap <C-PageDown> <C-\><C-n><C-PageDown>
|
||||
tmap <M-Up> <C-\><C-n><C-W>k
|
||||
tmap <M-Down> <C-\><C-n><C-W>j
|
||||
tmap <M-Right> <C-\><C-n><C-W>l
|
||||
tmap <M-Left> <C-\><C-n><C-W>h
|
||||
" }}}
|
||||
|
||||
set grepprg=ag\ --nogroup\ --nocolor
|
||||
|
||||
nmap <C-/> :Gr <C-R><C-W>
|
||||
|
||||
" Ctrl-Shift-T -> Open new tab
|
||||
nmap <C-S-T> :tabedit<CR>
|
||||
|
||||
" Ctrl-S to save file {{{
|
||||
nmap <C-s> :w<CR>
|
||||
vmap <C-s> <Esc><c-s>gv
|
||||
imap <C-s> <Esc><c-s>
|
||||
nmap <C-PageUp> :BufferLineCyclePrev<CR>
|
||||
nmap <C-PageDown> :BufferLineCycleNext<CR>
|
||||
]])
|
||||
lvim.builtin.dap.active = true
|
||||
|
||||
local dap = require('dap')
|
||||
dap.adapters.php = {
|
||||
type = 'executable',
|
||||
command = 'node',
|
||||
args = {
|
||||
'/home/harish/tmp/nvim-configs/lunarvim/share/nvim/mason/packages/php-debug-adapter/extension/out/phpDebug.js' }
|
||||
}
|
||||
|
||||
dap.configurations.php = {
|
||||
{
|
||||
type = 'php',
|
||||
request = 'launch',
|
||||
name = 'Listen for Xdebug',
|
||||
port = 9003
|
||||
}
|
||||
}
|
||||
|
||||
lvim.plugins = {
|
||||
{
|
||||
"gpanders/editorconfig.nvim",
|
||||
},
|
||||
}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
THIS_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
env PKG=lunarvim alacritty -e "$THIS_DIR/nvim-distro.sh" "$@" &
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
THIS_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
nvconf="$THIS_DIR/$PKG"
|
||||
|
||||
if [[ -d $nvconf ]]; then
|
||||
mkdir -p $nvconf/cache
|
||||
env XDG_CACHE_DIR=$nvconf/cache XDG_CACHE_HOME=$nvconf/cache XDG_DATA_HOME=$nvconf/share XDG_CONFIG_HOME=$nvconf nvim $@
|
||||
else
|
||||
echo "invalid \$PKG. Available values:"
|
||||
ls `dirname $nvconf`
|
||||
fi
|
||||
Reference in New Issue
Block a user