From 6cdb7ecc61b0a990c3ac858db217ac76b7bff9bc Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Mon, 17 Aug 2020 18:51:37 +0200 Subject: [PATCH] div updates --- fish/config.fish | 22 + fish/fish_prompt.fish | 27 ++ fish/fish_variables | 33 ++ hjalmar-droneship/onedrive/config | 2 + hjalmar-mothership/onedrive/config | 37 ++ ...yter_qtconsole_config-hjalmar-droneship.py | 420 ------------------ manjaro.md | 43 +- nvim/coc-settings.json | 8 +- nvim/init.vim | 118 ++--- .../__pycache__/__init__.cpython-38.opt-1.pyc | Bin 150 -> 0 bytes .../__pycache__/zenburn.cpython-38.opt-1.pyc | Bin 2406 -> 0 bytes ranger/rc.conf | 4 +- ranger/scope.sh | 121 +++++ root/.bashrc | 7 + root/.gitconfig | 2 +- root/.profile | 1 + 16 files changed, 345 insertions(+), 500 deletions(-) create mode 100644 fish/fish_prompt.fish create mode 100644 fish/fish_variables create mode 100644 hjalmar-droneship/onedrive/config create mode 100644 hjalmar-mothership/onedrive/config delete mode 100644 jupyter/jupyter_qtconsole_config-hjalmar-droneship.py delete mode 100644 ranger/colorschemes/__pycache__/__init__.cpython-38.opt-1.pyc delete mode 100644 ranger/colorschemes/__pycache__/zenburn.cpython-38.opt-1.pyc create mode 100755 ranger/scope.sh diff --git a/fish/config.fish b/fish/config.fish index 10595db..18262ab 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -1 +1,23 @@ thefuck --alias | source + +set -x VISUAL /usr/bin/nvim +set -x EDITOR /usr/bin/nvim +set -x BROWSER /usr/bin/chromium +set -x QT_QPA_PLATFORMTHEME "qt5ct" +set -x GTK2_RC_FILES "$HOME/.gtkrc-2.0" +set -x PYTHONBREAKPOINT ipdb.set_trace +set -x JAVA_HOME "/usr/lib/jvm/java-14-openjdk/bin/javac" + +# cuda stuff +set -x CUDA_HOME /opt/cuda +set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH:$CUDA_HOME/lib64 +set -x PATH $CUDA_HOME/bin:/home/hjalmarlucius/.local/bin/:$PATH + +# Base16 Shell +if status --is-interactive + set BASE16_SHELL "$HOME/.config/base16-shell/" + source "$BASE16_SHELL/profile_helper.fish" +end + +# MKL AMD fix +set -x MKL_DEBUG_CPU_TYPE 5 diff --git a/fish/fish_prompt.fish b/fish/fish_prompt.fish new file mode 100644 index 0000000..4f86aec --- /dev/null +++ b/fish/fish_prompt.fish @@ -0,0 +1,27 @@ +function fish_prompt --description 'Write out the prompt' + set -l last_pipestatus $pipestatus + set -l last_status $status + set -l normal (set_color normal) + + # Color the prompt differently when we're root + set -l color_cwd $fish_color_cwd + set -l prefix + set -l suffix '>' + if contains -- $USER root toor + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + end + set suffix '#' + end + + # If we're running via SSH, change the host color. + set -l color_host $fish_color_host + if set -q SSH_TTY + set color_host $fish_color_host_remote + end + + # Write pipestatus + set -l prompt_status (__fish_print_pipestatus " [" "]" "|" (set_color $fish_color_status) (set_color --bold $fish_color_status) $last_pipestatus) + + echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal $prompt_status $suffix " " +end diff --git a/fish/fish_variables b/fish/fish_variables new file mode 100644 index 0000000..7d6ae84 --- /dev/null +++ b/fish/fish_variables @@ -0,0 +1,33 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:3100 +SETUVAR fish_color_autosuggestion:969896 +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:c397d8 +SETUVAR fish_color_comment:e7c547 +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:c397d8 +SETUVAR fish_color_error:d54e53 +SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:00a6b2 +SETUVAR fish_color_param:7aa6da +SETUVAR fish_color_quote:b9ca4a +SETUVAR fish_color_redirection:70c0b1 +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell\x0aType\x20\x60help\x60\x20for\x20instructions\x20on\x20how\x20to\x20use\x20fish +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:B3A06D\x1eyellow +SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_user_paths:/home/hjalmarlucius/\x2efzf/bin diff --git a/hjalmar-droneship/onedrive/config b/hjalmar-droneship/onedrive/config new file mode 100644 index 0000000..0a57578 --- /dev/null +++ b/hjalmar-droneship/onedrive/config @@ -0,0 +1,2 @@ +sync_dir="/home/hjalmarlucius/Onedrive" +skip_dir="Bilder|Pictures|Videos|Backup|Music|Datasets|tmp|Programming/logs" diff --git a/hjalmar-mothership/onedrive/config b/hjalmar-mothership/onedrive/config new file mode 100644 index 0000000..4921bc6 --- /dev/null +++ b/hjalmar-mothership/onedrive/config @@ -0,0 +1,37 @@ +# Configuration for OneDrive Linux Client +# This file contains the list of supported configuration fields +# with their default values. +# All values need to be enclosed in quotes +# When changing a config option below, remove the '#' from the start of the line +# For explanations of all config options below see docs/USAGE.md or the man page. +# +sync_dir = "/mnt/storage/Onedrive" +# skip_file = "~*|.~*|*.tmp" +# monitor_interval = "45" +# skip_dir = "Videos" +# log_dir = "/var/log/onedrive/" +# drive_id = "" +# upload_only = "false" +# check_nomount = "false" +# check_nosync = "false" +# download_only = "false" +# disable_notifications = "false" +# disable_upload_validation = "false" +# enable_logging = "false" +# force_http_11 = "false" +# force_http_2 = "false" +# local_first = "false" +# no_remote_delete = "false" +# skip_symlinks = "false" +# debug_https = "false" +# skip_dotfiles = "false" +# dry_run = "false" +# min_notify_changes = "5" +# monitor_log_frequency = "5" +# monitor_fullscan_frequency = "10" +# sync_root_files = "false" +# classify_as_big_delete = "1000" +# user_agent = "" +# remove_source_files = "false" +# skip_dir_strict_match = "false" +# application_id = "" diff --git a/jupyter/jupyter_qtconsole_config-hjalmar-droneship.py b/jupyter/jupyter_qtconsole_config-hjalmar-droneship.py deleted file mode 100644 index cdc0170..0000000 --- a/jupyter/jupyter_qtconsole_config-hjalmar-droneship.py +++ /dev/null @@ -1,420 +0,0 @@ -# Configuration file for jupyter-qtconsole. - -#------------------------------------------------------------------------------ -# ConnectionFileMixin(LoggingConfigurable) configuration -#------------------------------------------------------------------------------ - -## Mixin for configurable classes that work with connection files - -## JSON file in which to store connection info [default: kernel-.json] -# -# This file will contain the IP, ports, and authentication key needed to connect -# clients to this kernel. By default, this file will be created in the security -# dir of the current profile, but can be specified by absolute path. -#c.ConnectionFileMixin.connection_file = '' - -## set the control (ROUTER) port [default: random] -#c.ConnectionFileMixin.control_port = 0 - -## set the heartbeat port [default: random] -#c.ConnectionFileMixin.hb_port = 0 - -## set the iopub (PUB) port [default: random] -#c.ConnectionFileMixin.iopub_port = 0 - -## Set the kernel's IP address [default localhost]. If the IP address is -# something other than localhost, then Consoles on other machines will be able -# to connect to the Kernel, so be careful! -#c.ConnectionFileMixin.ip = '' - -## set the shell (ROUTER) port [default: random] -#c.ConnectionFileMixin.shell_port = 0 - -## set the stdin (ROUTER) port [default: random] -#c.ConnectionFileMixin.stdin_port = 0 - -## -#c.ConnectionFileMixin.transport = 'tcp' - -#------------------------------------------------------------------------------ -# JupyterConsoleApp(ConnectionFileMixin) configuration -#------------------------------------------------------------------------------ - -## Set to display confirmation dialog on exit. You can always use 'exit' or -# 'quit', to force a direct exit without any confirmation. -#c.JupyterConsoleApp.confirm_exit = True - -## Connect to an already running kernel -#c.JupyterConsoleApp.existing = '' - -## The kernel manager class to use. -#c.JupyterConsoleApp.kernel_manager_class = 'jupyter_client.manager.KernelManager' - -## The name of the default kernel to start. -#c.JupyterConsoleApp.kernel_name = 'python' - -## Path to the ssh key to use for logging in to the ssh server. -#c.JupyterConsoleApp.sshkey = '' - -## The SSH server to use to connect to the kernel. -#c.JupyterConsoleApp.sshserver = '' - -#------------------------------------------------------------------------------ -# Application(SingletonConfigurable) configuration -#------------------------------------------------------------------------------ - -## This is an application. - -## The date format used by logging formatters for %(asctime)s -#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S' - -## The Logging format template -#c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s' - -## Set the log level by value or name. -#c.Application.log_level = 30 - -#------------------------------------------------------------------------------ -# JupyterApp(Application) configuration -#------------------------------------------------------------------------------ - -## Base class for Jupyter applications - -## Answer yes to any prompts. -#c.JupyterApp.answer_yes = False - -## Full path of a config file. -#c.JupyterApp.config_file = '' - -## Specify a config file to load. -#c.JupyterApp.config_file_name = '' - -## Generate default config file. -#c.JupyterApp.generate_config = False - -#------------------------------------------------------------------------------ -# JupyterQtConsoleApp(JupyterApp,JupyterConsoleApp) configuration -#------------------------------------------------------------------------------ - -## Whether to display a banner upon starting the QtConsole. -#c.JupyterQtConsoleApp.display_banner = True - -## Start the console window with the menu bar hidden. -#c.JupyterQtConsoleApp.hide_menubar = False - -## Start the console window maximized. -#c.JupyterQtConsoleApp.maximize = False - -## Use a plaintext widget instead of rich text (plain can't print/save). -#c.JupyterQtConsoleApp.plain = False - -## path to a custom CSS stylesheet -#c.JupyterQtConsoleApp.stylesheet = '' - -#------------------------------------------------------------------------------ -# ConsoleWidget(NewBase) configuration -#------------------------------------------------------------------------------ - -## An abstract base class for console-type widgets. This class has functionality -# for: -# -# * Maintaining a prompt and editing region -# * Providing the traditional Unix-style console keyboard shortcuts -# * Performing tab completion -# * Paging text -# * Handling ANSI escape codes -# -# ConsoleWidget also provides a number of utility methods that will be -# convenient to implementors of a console-style widget. - -## Whether to process ANSI escape codes. -#c.ConsoleWidget.ansi_codes = True - -## The maximum number of lines of text before truncation. Specifying a non- -# positive number disables text truncation (not recommended). -#c.ConsoleWidget.buffer_size = 500 - -## The height of the console at start time in number of characters (will double -# with `vsplit` paging) -#c.ConsoleWidget.console_height = 25 - -## The width of the console at start time in number of characters (will double -# with `hsplit` paging) -#c.ConsoleWidget.console_width = 81 - -## Whether to automatically execute on syntactically complete input. -# -# If False, Shift-Enter is required to submit each execution. Disabling this is -# mainly useful for non-Python kernels, where the completion check would be -# wrong. -#c.ConsoleWidget.execute_on_complete_input = True - -## The font family to use for the console. On OSX this defaults to Monaco, on -# Windows the default is Consolas with fallback of Courier, and on other -# platforms the default is Monospace. -#c.ConsoleWidget.font_family = '' - -## The font size. If unconfigured, Qt will be entrusted with the size of the -# font. -#c.ConsoleWidget.font_size = 0 - -## The type of completer to use. Valid values are: -# -# 'plain' : Show the available completion as a text list -# Below the editing area. -# 'droplist': Show the completion in a drop down list navigable -# by the arrow keys, and from which you can select -# completion by pressing Return. -# 'ncurses' : Show the completion as a text list which is navigable by -# `tab` and arrow keys. -#c.ConsoleWidget.gui_completion = 'ncurses' - -## Whether to include output from clients other than this one sharing the same -# kernel. -# -# Outputs are not displayed until enter is pressed. -c.ConsoleWidget.include_other_output = True - -## The type of underlying text widget to use. Valid values are 'plain', which -# specifies a QPlainTextEdit, and 'rich', which specifies a QTextEdit. -#c.ConsoleWidget.kind = 'plain' - -## Prefix to add to outputs coming from clients other than this one. -# -# Only relevant if include_other_output is True. -#c.ConsoleWidget.other_output_prefix = '[remote] ' - -## The type of paging to use. Valid values are: -# -# 'inside' -# The widget pages like a traditional terminal. -# 'hsplit' -# When paging is requested, the widget is split horizontally. The top -# pane contains the console, and the bottom pane contains the paged text. -# 'vsplit' -# Similar to 'hsplit', except that a vertical splitter is used. -# 'custom' -# No action is taken by the widget beyond emitting a -# 'custom_page_requested(str)' signal. -# 'none' -# The text is written directly to the console. -#c.ConsoleWidget.paging = 'inside' - -## The visibility of the scrollar. If False then the scrollbar will be invisible. -#c.ConsoleWidget.scrollbar_visibility = True - -#------------------------------------------------------------------------------ -# HistoryConsoleWidget(ConsoleWidget) configuration -#------------------------------------------------------------------------------ - -## A ConsoleWidget that keeps a history of the commands that have been executed -# and provides a readline-esque interface to this history. - -## -#c.HistoryConsoleWidget.history_lock = False - -#------------------------------------------------------------------------------ -# FrontendWidget(HistoryConsoleWidget,BaseFrontendMixin) configuration -#------------------------------------------------------------------------------ - -## A Qt frontend for a generic Python kernel. - -## -#c.FrontendWidget.banner = '' - -## Whether to clear the console when the kernel is restarted -#c.FrontendWidget.clear_on_kernel_restart = True - -## Whether to ask for user confirmation when restarting kernel -#c.FrontendWidget.confirm_restart = True - -## Whether to draw information calltips on open-parentheses. -#c.FrontendWidget.enable_calltips = True - -## The pygments lexer class to use. -#c.FrontendWidget.lexer_class = traitlets.Undefined - -#------------------------------------------------------------------------------ -# IPythonWidget(FrontendWidget) configuration -#------------------------------------------------------------------------------ - -## Dummy class for config inheritance. Destroyed below. - -#------------------------------------------------------------------------------ -# JupyterWidget(IPythonWidget) configuration -#------------------------------------------------------------------------------ - -## A FrontendWidget for a Jupyter kernel. - -## A command for invoking a GUI text editor. If the string contains a {filename} -# format specifier, it will be used. Otherwise, the filename will be appended to -# the end the command. To use a terminal text editor, the command should launch -# a new terminal, e.g. ``"gnome-terminal -- vim"``. -#c.JupyterWidget.editor = '' - -## The editor command to use when a specific line number is requested. The string -# should contain two format specifiers: {line} and {filename}. If this parameter -# is not specified, the line number option to the %edit magic will be ignored. -#c.JupyterWidget.editor_line = '' - -## -#c.JupyterWidget.in_prompt = 'In [%i]: ' - -## -#c.JupyterWidget.input_sep = '\n' - -## -#c.JupyterWidget.out_prompt = 'Out[%i]: ' - -## -#c.JupyterWidget.output_sep = '' - -## -#c.JupyterWidget.output_sep2 = '' - -## A CSS stylesheet. The stylesheet can contain classes for: -# 1. Qt: QPlainTextEdit, QFrame, QWidget, etc -# 2. Pygments: .c, .k, .o, etc. (see PygmentsHighlighter) -# 3. QtConsole: .error, .in-prompt, .out-prompt, etc -#c.JupyterWidget.style_sheet = '' - -## If not empty, use this Pygments style for syntax highlighting. Otherwise, the -# style sheet is queried for Pygments style information. -#c.JupyterWidget.syntax_style = '' - -#------------------------------------------------------------------------------ -# KernelManager(ConnectionFileMixin) configuration -#------------------------------------------------------------------------------ - -## Manages a single kernel in a subprocess on this host. -# -# This version starts kernels with Popen. - -## Should we autorestart the kernel if it dies. -#c.KernelManager.autorestart = True - -## DEPRECATED: Use kernel_name instead. -# -# The Popen Command to launch the kernel. Override this if you have a custom -# kernel. If kernel_cmd is specified in a configuration file, Jupyter does not -# pass any arguments to the kernel, because it cannot make any assumptions about -# the arguments that the kernel understands. In particular, this means that the -# kernel does not receive the option --debug if it given on the Jupyter command -# line. -#c.KernelManager.kernel_cmd = [] - -## Time to wait for a kernel to terminate before killing it, in seconds. -#c.KernelManager.shutdown_wait_time = 5.0 - -#------------------------------------------------------------------------------ -# KernelRestarter(LoggingConfigurable) configuration -#------------------------------------------------------------------------------ - -## Monitor and autorestart a kernel. - -## Whether to include every poll event in debugging output. -# -# Has to be set explicitly, because there will be *a lot* of output. -#c.KernelRestarter.debug = False - -## Whether to choose new random ports when restarting before the kernel is alive. -#c.KernelRestarter.random_ports_until_alive = True - -## The number of consecutive autorestarts before the kernel is presumed dead. -#c.KernelRestarter.restart_limit = 5 - -## Kernel heartbeat interval in seconds. -#c.KernelRestarter.time_to_dead = 3.0 - -#------------------------------------------------------------------------------ -# Session(Configurable) configuration -#------------------------------------------------------------------------------ - -## Object for handling serialization and sending of messages. -# -# The Session object handles building messages and sending them with ZMQ sockets -# or ZMQStream objects. Objects can communicate with each other over the -# network via Session objects, and only need to work with the dict-based IPython -# message spec. The Session will handle serialization/deserialization, security, -# and metadata. -# -# Sessions support configurable serialization via packer/unpacker traits, and -# signing with HMAC digests via the key/keyfile traits. -# -# Parameters ---------- -# -# debug : bool -# whether to trigger extra debugging statements -# packer/unpacker : str : 'json', 'pickle' or import_string -# importstrings for methods to serialize message parts. If just -# 'json' or 'pickle', predefined JSON and pickle packers will be used. -# Otherwise, the entire importstring must be used. -# -# The functions must accept at least valid JSON input, and output *bytes*. -# -# For example, to use msgpack: -# packer = 'msgpack.packb', unpacker='msgpack.unpackb' -# pack/unpack : callables -# You can also set the pack/unpack callables for serialization directly. -# session : bytes -# the ID of this Session object. The default is to generate a new UUID. -# username : unicode -# username added to message headers. The default is to ask the OS. -# key : bytes -# The key used to initialize an HMAC signature. If unset, messages -# will not be signed or checked. -# keyfile : filepath -# The file containing a key. If this is set, `key` will be initialized -# to the contents of the file. - -## Threshold (in bytes) beyond which an object's buffer should be extracted to -# avoid pickling. -#c.Session.buffer_threshold = 1024 - -## Whether to check PID to protect against calls after fork. -# -# This check can be disabled if fork-safety is handled elsewhere. -#c.Session.check_pid = True - -## Threshold (in bytes) beyond which a buffer should be sent without copying. -#c.Session.copy_threshold = 65536 - -## Debug output in the Session -#c.Session.debug = False - -## The maximum number of digests to remember. -# -# The digest history will be culled when it exceeds this value. -#c.Session.digest_history_size = 65536 - -## The maximum number of items for a container to be introspected for custom -# serialization. Containers larger than this are pickled outright. -#c.Session.item_threshold = 64 - -## execution key, for signing messages. -#c.Session.key = b'' - -## path to file containing execution key. -#c.Session.keyfile = '' - -## Metadata dictionary, which serves as the default top-level metadata dict for -# each message. -#c.Session.metadata = {} - -## The name of the packer for serializing messages. Should be one of 'json', -# 'pickle', or an import name for a custom callable serializer. -#c.Session.packer = 'json' - -## The UUID identifying this session. -#c.Session.session = '' - -## The digest scheme used to construct the message signatures. Must have the form -# 'hmac-HASH'. -#c.Session.signature_scheme = 'hmac-sha256' - -## The name of the unpacker for unserializing messages. Only used with custom -# functions for `packer`. -#c.Session.unpacker = 'json' - -## Username for the Session. Default is your system username. -#c.Session.username = 'hjalmarlucius' diff --git a/manjaro.md b/manjaro.md index d8c9893..139e439 100644 --- a/manjaro.md +++ b/manjaro.md @@ -1,25 +1,29 @@ # linux -* storage - * `yay megasync` - * `yay onedrive-abraunegg` - * `yay dropbox` -* nvidia - * `sudo pacman -S cuda` - * `yay nvidia-vulkan` +* yay stuff + * AUR `sudo pacman -S yay` + * `yay onedrive-abraunegg dropbox slack-desktop ncspot-git nvidia-vulkan` * applications - * `sudo pacman -S npm nodejs` - * `sudo pacman -S ninja the_silver_searcher` - * `sudo pacman -S zathura-pdf-mupdf redshift yay trash-cli rofi` - * `yay ncspot-git` -* code - * `sudo pacman -S neovim powerline tmux diff-so-fancy ttf-inconsolata` -* gaming - * `sudo pacman -S steam-manjaro steam-native` + * helpers `sudo pacman -S zathura-pdf-mupdf trash-cli rofi` + * base16 shell `git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell` + * night colors `sudo pacman -S redshift` + * gaming `sudo pacman -S steam-manjaro steam-native` + +# coding +* cuda `sudo pacman -S cuda` +* core `sudo pacman -S neovim tmux` +* fonts `sudo pacman -S ttf-inconsolata powerline` +* git addons `sudo pacman -S diff-so-fancy` +* search `sudo pacman -S the_silver_searcher ripgrep` +* syntax highlighting `sudo pacman -S bat` +* javascript `sudo pacman -S npm nodejs yarn` +* c++ `sudo pacman -S ninja` + +# settings +* set shell to 'fish' via `bmenu` +* replace caps with esc `setxkbmap -option 'caps:escape' ` * ssh setup * enable SSH `sudo systemctl enable --now sshd.service` * enable X11 forwarding in `/etc/ssh/sshd_config` -* set shell to 'fish' via `bmenu` -* replace caps with esc `setxkbmap -option 'caps:escape` # python * `pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html` @@ -34,3 +38,8 @@ # IP * hjalmar-droneship 88.89.64.249 10.0.0.2 + +OMF +* curl -L https://get.oh-my.fish | fish +* omf install https://github.com/FabioAntunes/fish-nvm +* omf install https://github.com/edc/bass diff --git a/nvim/coc-settings.json b/nvim/coc-settings.json index b8988f2..ddcefed 100644 --- a/nvim/coc-settings.json +++ b/nvim/coc-settings.json @@ -1,12 +1,16 @@ { "signature.target": "echo", - "python.jediEnabled": true, "suggest.autoTrigger": "always", + "python.jediEnabled": true, "python.autoComplete.addBrackets": true, "python.linting.pylintEnabled": false, "python.linting.flake8Enabled": true, "python.linting.pylintArgs": ["--disable=all", "--enable=F,E,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode"], "python.linting.flake8Args": ["--ignore=E226,E231,E241,E501,E701,E704"], "python.linting.enabled": true, - "git.enableGutters": true + "git.enableGutters": true, + "tabnine.shortcut": "TN", + "yaml.format.enable": true, + "yaml.format.singleQuote": true + } diff --git a/nvim/init.vim b/nvim/init.vim index ef83e96..8a8916d 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -7,6 +7,14 @@ if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) silent !mkdir -p ~/.config/nvim/autoload/ silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim endif +let g:coc_global_extensions = [ + \ 'coc-fzf-preview', + \ 'coc-python', + \ 'coc-git', + \ 'coc-tsserver', + \ 'coc-diagnostic', + \ 'coc-yaml' + \ ] call plug#begin('~/.config/nvim/plugged') " tools @@ -54,11 +62,18 @@ call plug#end() " ----------------------------------------------------------------------------- " format " ----------------------------------------------------------------------------- -"if has("nvim") -" set termguicolors -"endif -let base16colorspace=256 -colorscheme seoul256 +set t_Co=256 " Use 256 colors +if filereadable(expand("~/.vimrc_background")) + let base16colorspace=256 + source ~/.vimrc_background +endif +if has("nvim") + if $TERM =~ '^\(rxvt\)\(-.*\)\?$' + set notermguicolors + else + set termguicolors + endif +endif "let g:airline_theme='molokai' "let g:airline_theme='qwq' let g:airline_theme='badwolf' @@ -79,6 +94,8 @@ let g:BASH_Ctrl_l='off' " avoid 'C-l' being overridden to newline set updatetime=300 set timeoutlen=500 set lazyredraw +" set shell=/usr/bin/bash +" let $SHELL = "/usr/bin/bash" " fold config set foldmethod=indent @@ -103,6 +120,10 @@ autocmd BufWritePre * %s/\s\+$//e " default new file is markdown autocmd BufEnter * if &filetype == "" | setlocal ft=markdown | endif +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab set fileformat=unix au Filetype python set \ tabstop=4 @@ -196,22 +217,36 @@ nmap :execute 'silent! tabmove ' . (tabpagenr()-2) nmap :execute 'silent! tabmove ' . (tabpagenr()+1) " fzf -nmap g :GitFiles -nmap f :Files -nmap l :Fag -nmap l :Ag -nmap L :Lines -nmap r :Rg -nmap b :Buffers -nmap c :Commands +"nmap g :GitFiles +"nmap f :Files +"nmap l :Ag +"nmap L :Lines +"nmap r :Rg +"nmap b :Buffers +"nmap c :Commands nmap t :Colors -nmap m :Marks -nmap w :Windows -nmap :Maps -let g:fzf_action={ - \ 'ctrl-o': 'tab split', - \ 'ctrl-h': 'split', - \ 'ctrl-l': 'vsplit' } +"nmap m :Marks +"nmap w :Windows +"nmap :Maps +nmap [fzf-p] +xmap [fzf-p] + +nnoremap [fzf-p]f :CocCommand fzf-preview.FromResources project_mru git +nnoremap [fzf-p]F :CocCommand fzf-preview.DirectoryFiles +nnoremap [fzf-p]g :CocCommand fzf-preview.GitStatus +nnoremap [fzf-p]G :CocCommand fzf-preview.GitActions +nnoremap [fzf-p]b :CocCommand fzf-preview.Buffers +nnoremap [fzf-p]B :CocCommand fzf-preview.AllBuffers +" nnoremap [fzf-p]o :CocCommand fzf-preview.FromResources buffer project_mru +" nnoremap [fzf-p] :CocCommand fzf-preview.Jumps +" nnoremap [fzf-p]g; :CocCommand fzf-preview.Changes +nnoremap [fzf-p]/ :CocCommand fzf-preview.Lines --add-fzf-arg=--no-sort --add-fzf-arg=--query="'" +nnoremap [fzf-p]* :CocCommand fzf-preview.Lines --add-fzf-arg=--no-sort --add-fzf-arg=--query="'=expand('')" +nnoremap [fzf-p]l :CocCommand fzf-preview.ProjectGrep +xnoremap [fzf-p]l "sy:CocCommand fzf-preview.ProjectGrep-F"=substitute(substitute(@s, '\n', '', 'g'), '/', '\\/', 'g')" +nnoremap [fzf-p]t :CocCommand fzf-preview.BufferTags +"nnoremap [fzf-p]q :CocCommand fzf-preview.QuickFix +"nnoremap [fzf-p]l :CocCommand fzf-preview.LocationList " Close preview window when completion is done autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif @@ -246,17 +281,6 @@ nmap gg :vertical Gstatus:vertical resize 60 " nerdtree map N :NERDTreeToggle -" ranger.vim -"map rr :RangerEdit -"map rv :RangerVSplit -"map rs :RangerSplit -"map rt :RangerTab -"map ri :RangerInsert -"map ra :RangerAppend -"map rc :set operatorfunc=RangerChangeOperatorg@ -"map rd :RangerCD -"map rld :RangerLCD - " nerdcommenter " 'c ', 'cl' aligned and 'cu>' remove @@ -371,10 +395,8 @@ function! s:check_back_space() abort return !col || getline('.')[col - 1] =~# '\s' endfunction nmap K :call show_documentation() - -" fzf files with preview -command! -bang -nargs=? -complete=dir Files - \ call fzf#vim#files(, {'options': ['--info=default', '--preview', 'cat {}']}, 1) +let g:coc_node_path = '/usr/bin/node' +let g:fzf_preview_command = 'bat --color=always --plain {-1}' " Installed bat " vim asterisk let g:asterisk#keeppos = 1 @@ -400,22 +422,6 @@ function! s:show_documentation() endif endfunction -" fzf -let s:TYPE={'dict': type({}), 'funcref': type(function('call')), 'string': type(''), 'list': type([])} - -if !exists("*s:fag") -function! s:fag(query, ...) - if type(a:query) != s:TYPE.string - return s:warn('Invalid query argument') - endif - let query=empty(a:query) ? '^(?=.)' : a:query - let args=copy(a:000) - let ag_opts=len(args) > 1 && type(args[0]) == s:TYPE.string ? remove(args, 0) : '--follow' - let command=ag_opts . ' ' . fzf#shellescape(query) - return call('fzf#vim#ag_raw', insert(args, command, 0)) -endfunction -endif - " for moving of tabs if !exists("*MoveToPrevTab") function MoveToPrevTab() @@ -525,7 +531,6 @@ set splitbelow " Puts new split windows to the bottom of the current set autowrite " Automatically write a file when leaving a modified buffer set mousehide " Hide the mouse cursor while typing set hidden " Allow buffer switching without saving -set t_Co=256 " Use 256 colors set ruler " Show the ruler set showcmd " Show partial commands in status line and Selected characters/lines in visual mode set showmode " Show current mode in command-line @@ -535,10 +540,6 @@ set report=0 " Always report changed lines set linespace=0 " No extra spaces between rows set pumheight=20 " Avoid the pop up menu occupying the whole screen -if !exists('g:vim_better_default_tabs_as_spaces') || g:vim_better_default_tabs_as_spaces - set expandtab " Tabs are spaces, not tabs -end - " http://stackoverflow.com/questions/6427650/vim-in-tmux-background-color-changes-when-paging/15095377#15095377 set t_ut= @@ -608,7 +609,6 @@ endif set cursorline " Highlight current line set fileformats=unix,dos,mac " Use Unix as the standard file type set number " Line numbers on -"set relativenumber " Relative numbers on set fillchars=vert:│,stl:\ ,stlnc:\ " Annoying temporary files @@ -706,14 +706,14 @@ if get(g:, 'vim_better_default_key_mapping', 1) " } " File { - if get(g:, 'vim_better_default_file_key_mapping', 1) + if get(g:, 'vim_better_default_file_key_mapping', 0) " File save nnoremap fs :update endif " } " Fold { - if get(g:, 'vim_better_default_fold_key_mapping', 1) + if get(g:, 'vim_better_default_fold_key_mapping', 0) nnoremap f0 :set foldlevel=0 nnoremap f1 :set foldlevel=1 nnoremap f2 :set foldlevel=2 diff --git a/ranger/colorschemes/__pycache__/__init__.cpython-38.opt-1.pyc b/ranger/colorschemes/__pycache__/__init__.cpython-38.opt-1.pyc deleted file mode 100644 index c7c6b9a357c7c80d405992d3f72f91349b212ef0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmWIL<>g`kg7@Fr<3RLd5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!Huenx(7s(waR zVoq*iQBG-cW@)j$UUGh3T4uU_QDRr0TXvvbbwPBL?5J!dv; zN*06`d<`Plzd$O858@vn{R8^chk71V(3hwn_)tWI`uoo8E~|8h^PTVa-7k~fygxZv zb@2J)?k5+&pLLv{35|4i%F|q(kJ};>fbLREiqVe;u!f`OL4>pJa%bJ+E&_Snzviqn&JeI-#@2;w zbd}soVHcCv;8OuZ=M;{<<2z2_eBk%Ip5J3T?uM)83g^57&f9g>H@JPZP_Q18tf*Lv zK(9hNrq;OI^Emu~LiH9$3~=M>0%w-1s*Aj0xteP8z;Y8x@iEIys%tx}n0m+QF^U7v zX?1-l345Mgf^0_JEcW4^#hJu;0B5eruDbf>(01H<&#BwI3a%fMZ1qo|52`NCR#9-rI{pgB!_%Rvuh(}wLq z+#lk87#3}g3j1*n0e@D;QXdavxf_SAd@v7m51U7JJ#_;%Y|Vl8D?Zipk!K3o?n3)0 zv@;_S9)ryfkW=M%xQl)a%|jl8Y#OrPInDG4(Btr=_y=%L!N!*pK>H~hO+a1;IzkBd z6Sz!STpCAaK+y&Zpt zHGO;wOrPER8h_+_zY+P1NJiu&k%GwQM1BNO^o6kZEscNqV|#CRWrp! zGwP;AJ*Mv|Z7ND=QJ88X>kXA((n6U~i&Vsg;ATvTEupk9fy`AFrKTdXPO*(ksa%<$ zkt+^|N|Hq_VJce*7rCiKU7qA7oXa9gBrI7YPq`WAi9&*0ZJVmNEaGkv zHBw>xNFsD5coG@bOq#g~bRKV_x`2zVBo>CHiQF`-mFL{}jfk6S5w+@Bq&5-TM;sHx zc_%^TwG0WV$8IJ~U@g!NToQ@6HRy_@NJS$;yX{;TGRjZ@>M#?~=^`q+nv}JUP+6jN zl1pvIGNCnf8l-u|k!7}{@)icD>#!{+YR0x=ZIg_HiSsN=3d0I<8FOeSt#*o2lm$e3 zb1M;-OvRRB9h(W}P_vG*nIQgiq8K7$Ifj3D%5I_|;)pe$$N6%BW_q*)m?EWmr@c>Pttxi?`_S z6D#dJ6D#eFD8*#cZk%-W$}(Jt!kxwz3k7RUb#~Kk}Y?(jo;N`3PJRg3+h(A zz-3uKZE$Ct&KR!d-vBd?@F!zi@%H+ zoy9J~dY#_Odfim(^(^Pzl=z8y{iAM_mKwE+DXMcsXf-3`J%aSlObtg9gKj)4IlIWr r{&G*tt!{$N(N}@pm7@PM%*_9l)@>xX%|#hZ_*z-m>){~H1jg_$VKtFP diff --git a/ranger/rc.conf b/ranger/rc.conf index ee59ce8..a927f59 100644 --- a/ranger/rc.conf +++ b/ranger/rc.conf @@ -614,7 +614,9 @@ tmap eval -q fm.ui.taskview.task_remove() tmap redraw_window tmap taskview_close copytmap q Q w -default_linemode devicons # find map fzf_select + +# plugins +default_linemode devicons diff --git a/ranger/scope.sh b/ranger/scope.sh new file mode 100755 index 0000000..267179d --- /dev/null +++ b/ranger/scope.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash +# ranger supports enhanced previews. If the option "use_preview_script" +# is set to True and this file exists, this script will be called and its +# output is displayed in ranger. ANSI color codes are supported. + +# NOTES: This script is considered a configuration file. If you upgrade +# ranger, it will be left untouched. (You must update it yourself.) +# Also, ranger disables STDIN here, so interactive scripts won't work properly + +# Meanings of exit codes: +# code | meaning | action of ranger +# -----+------------+------------------------------------------- +# 0 | success | success. display stdout as preview +# 1 | no preview | failure. display no preview at all +# 2 | plain text | display the plain content of the file +# 3 | fix width | success. Don't reload when width changes +# 4 | fix height | success. Don't reload when height changes +# 5 | fix both | success. Don't ever reload +# 6 | image | success. display the image $cached points to as an image preview +# 7 | image | success. display the file directly as an image + +# Meaningful aliases for arguments: +path="$1" # Full path of the selected file +width="$2" # Width of the preview pane (number of fitting characters) +height="$3" # Height of the preview pane (number of fitting characters) +cached="$4" # Path that should be used to cache image previews +preview_images="$5" # "True" if image previews are enabled, "False" otherwise. + +maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln + +# Find out something about the file: +mimetype=$(file --mime-type -Lb "$path") +extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') + +# Functions: +# runs a command and saves its output into $output. Useful if you need +# the return value AND want to use the output in a pipe +try() { output=$(eval '"$@"'); } + +# writes the output of the previously used "try" command +dump() { /bin/echo "$output"; } + +# a common post-processing function used after most commands +trim() { head -n "$maxln"; } + +# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success +safepipe() { "$@"; test $? = 0 -o $? = 141; } + +# Image previews, if enabled in ranger. +if [ "$preview_images" = "True" ]; then + case "$mimetype" in + # Image previews for SVG files, disabled by default. + image/svg+xml) + convert "$path" "$cached" && exit 6 || exit 1;; + # Image previews for image files. w3mimgdisplay will be called for all + # image files (unless overriden as above), but might fail for + # unsupported types. + image/*) + exit 7;; + # Image preview for video, disabled by default.: + video/*) + ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; + esac +fi + +case "$extension" in + # Archive extensions: + a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ + rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) + try als "$path" && { dump | trim; exit 0; } + try acat "$path" && { dump | trim; exit 3; } + try bsdtar -lf "$path" && { dump | trim; exit 0; } + exit 1;; + rar) + # avoid password prompt by providing empty password + try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; + 7z) + # avoid password prompt by providing empty password + try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; + # PDF documents: + pdf) + try pdftotext -l 10 -nopgbrk -q "$path" - && \ + { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; + # BitTorrent Files + torrent) + try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; + # ODT Files + odt|ods|odp|sxw) + try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; + # HTML Pages: + htm|html|xhtml) + try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + ;; # fall back to highlight/cat if the text browsers fail +esac + +case "$mimetype" in + # Syntax highlight for text files: + text/* | */xml) + if [ "$(tput colors)" -ge 256 ]; then + pygmentize_format=terminal256 + highlight_format=xterm256 + else + pygmentize_format=terminal + highlight_format=ansi + fi + try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; } + try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; } + exit 2;; + # Ascii-previews of images: + image/*) + img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + # Display information about media files: + video/* | audio/*) + exiftool "$path" && exit 5 + # Use sed to remove spaces so the output fits into the narrow window + try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; +esac + +exit 1 diff --git a/root/.bashrc b/root/.bashrc index 9c8fbbd..74c5007 100644 --- a/root/.bashrc +++ b/root/.bashrc @@ -140,3 +140,10 @@ ex () [ -f ~/.fzf.bash ] && source ~/.fzf.bash +# Base16 Shell +BASE16_SHELL="$HOME/.config/base16-shell/" +[ -n "$PS1" ] && \ + [ -s "$BASE16_SHELL/profile_helper.sh" ] && \ + eval "$("$BASE16_SHELL/profile_helper.sh")" + +source /usr/share/nvm/init-vnm.sh diff --git a/root/.gitconfig b/root/.gitconfig index af6b37f..9d0f329 100644 --- a/root/.gitconfig +++ b/root/.gitconfig @@ -1,6 +1,6 @@ [core] autocrlf = input - fileMode = false + filemode = false pager = diff-so-fancy | less --tabs=4 -RFX autorcrlf = true [user] diff --git a/root/.profile b/root/.profile index e68f7fb..ef31b5d 100644 --- a/root/.profile +++ b/root/.profile @@ -4,6 +4,7 @@ export BROWSER=/usr/bin/chromium export QT_QPA_PLATFORMTHEME="qt5ct" export GTK2_RC_FILES="$HOME/.gtkrc-2.0" export PYTHONBREAKPOINT=ipdb.set_trace +export JAVA_HOME="/usr/lib/jvm/java-14-openjdk/bin/javac" # cuda stuff