Linux终端基础环境设置

本文介绍了Linux终端的基础环境设置,包括.bashrc文件的个性化配置,.vimrc文件的Vim编辑器设置,以及.gitconfig文件的Git个性化选项,帮助用户提升终端使用体验。

Table of Contents

bashrc

vimrc

gitconfig


bashrc

export PS1="\[\033[0;37m\][\u@\h \t \w]\[\033[00m\] "

set -o vi
export TERM=xterm
export EDITOR=vi

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=5000
HISTFILESIZE=5000
# Save and reload the history after each command finishes
#export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
h() {
    _bash_history_sync
    #builtin history "$@"
}
_bash_history_sync() {
    builtin history -a
    HISTFILESIZE=$HISTFILESIZE
    builtin history -c
    builtin history -r
}
export PROMPT_COMMAND=_bash_history_sync

alias c=clear
alias l='ls -lh'
alias la='ls -a'
alias ll='ls -la'
alias lr='ls -lrt'
alias psof='ps -ef | grep -v grep | grep '
alias finda='find . -name '
alias vin='vim -u NONE'
alias sudo='sudo -E'

alias cd.='cd ../'
alias cd..='cd ../../'
alias cd...='cd ../../../'
alias cd....='cd ../../../../'
alias cd.....='cd ../../../../../'
alias sd='echo $PWD > ~/.oldpwd'
alias ds='cd `cat ~/.oldpwd`'

vimrc

set nocompatible	" Use Vim defaults (much better!)
set bs=indent,eol,start		" allow backspacing over everything in insert mode
set viminfo='20,\"500	" read/write a .viminfo file, don't store more
set history=500		" keep 50 lines of command line history
set ruler		" show the cursor position all the time

" Uncomment the following to have Vim jump to the last position when reopening a file
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif

" search
set showmatch		" Show matching brackets.
set smartcase		" Do smart case matching
set incsearch		" Incremental search
set hlsearch
set ignorecase
set nowrapscan

" code read
"filetype plugin indent on
filetype on
syntax on
set cin
set ai
set foldmethod=syntax
set foldlevel=100
set noexpandtab
set tabstop=8
set shiftwidth=8
let local_vimrc = findfile(".vimrc.local", ".;")
if filereadable(local_vimrc)
  exec "source "local_vimrc
endif
function! Tab4()
    set ts=4
    set sw=4
    set expandtab
endfunction
noremap <Leader>4 :call Tab4()<cr>
function! Tab8()
    set ts=8
    set sw=8
    set noexpandtab
endfunction
noremap <Leader>8 :call Tab8()<cr>

" file
set nu
set noswapfile
set nobackup
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936

" Cursor
set cursorline
"set cursorcolumn
"hi CursorLine term=reverse cterm=NONE ctermbg=black ctermfg=NONE
"hi CursorColumn term=reverse cterm=NONE ctermbg=black ctermfg=NONE
set scrolloff=3


" move
noremap <C-j> <C-e>
noremap <C-k> <C-y>

" Tag list settings
map <F4> :Tlist<CR>
nnoremap <Leader>tl :Tlist<CR>
let Tlist_Exit_OnlyWindow = 1
let Tlist_Auto_Open = 1
let Tlist_Show_One_File=1
let Tlist_Sort_Type = 'name'

" It's useful to show the buffer number in the status line.
set laststatus=2 statusline=%02n:%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
map <F2> :mksession! ~/.vim_session <cr> " Quick write session with F2
map <F3> :source ~/.vim_session <cr>     " And load session with F3


" copy paste
vmap <C-y>  :w! ~/.vimbuf<CR>
nmap <C-y>  :. w! ~/.vimbuf<CR>
nmap <C-p>  :r ~/.vimbuf<CR>

gitconfig

[user]
	name = imtank
	email = imtank@gmail.com
[diff]
	tool = vimdiff
[difftool]
	prompt = false
[alias]
	c = checkout
	b = branch
	d = difftool
	l = log --date=short --pretty=format:'[%h %ad %an] %s'
	s = status -uno
	f = show --name-only
	u = rm --cached

 

内容概要:本文档详细介绍了基于Python的食物营养分析与推荐网站的设计和实现。项目旨在通过个性化营养推荐、数据驱动的精准分析,以及健康饮食的普及与推广,帮助用户养成健康的饮食习惯。平台采用Python作为主要开发语言,结合Flask框架和机器学习算法,通过爬取食物营养成分数据并进行整理与分析,开发出高效的在线平台。用户可通过简单操作获取全面的食物营养信息和个性化饮食建议。平台不仅满足个人用户需求,还为营养师、健身教练及食品行业提供专业支持,推动智能健康产业发展。项目挑战包括数据准确性、个性化推荐、用户界面友好性、数据隐私与安全性和系统的可扩展性,解决方案涉及多源数据融合、机器学习算法优化、用户体验设计、数据加密技术和分布式架构。项目特点涵盖个性化推荐引擎、多维度数据分析、自主食物数据输入、智能化饮食管理、实时数据更新与反馈机制、数据可视化展示、社交化健康互动、健康指标自动追踪和平台开放API接口。未来改进方向包括引入深度学习模型、增强多模态数据分析、个性化饮食计划生成、加强社区互动功能、多平台支持和增加饮食监控功能。适合人群:对健康饮食感兴趣的个人用户,营养师,健身教练,食品行业从业者。使用场景及目标:①为个人用户提供便捷的食物营养分析工具和个性化的饮食推荐服务;②为营养师和健身教练提供专业的营养分析工具;③为食品行业提供数据支持,优化产品研发和营销策略;④推动健康饮食文化的普及,帮助用户养成健康的饮食习惯。其他说明:项目不仅提供了一个健康饮食管理平台,还将推动智能健康产业的发展。项目的成功实施可以为未来更多的健康管理平台提供技术支持,促进人工智能与大数据在健康管理领域的广泛应用。平台采用先进的加密技术保护用户的个人信息和健康数据,并严格遵守相关隐私政策和法规,确保数据安全与合规性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值