工具:vim一键编译执行+quickfix 打开显示错误信息

asyncrun.vim:快速执行异步Shell命令并输出到Vim Quickfix窗口 用户自定义命令的执行配置通常包含在Vim的配置文件.vimrc中,该文件位于用户的主目录下。编辑.vimrc文件可以使用Vim本身,也可以使用外部文本编辑器。在.vimrc中添加自定义命令时,需要遵循Vim的脚本语法。每一条命令或定义必须以换行符结束,以确保脚本的正确执行。Vim脚本支持变量、函数、条件判断、循环等编程结构。以下是一个简单的例子,展示如何在.vimrc中添加一个用户自定义命令:" 定义一个简单的函数,输出当前时间function! 阅读详情
"compile c c++ file in quickfix
nmap <F4> :call DoOneFileMake()<CR>
function DoOneFileMake()
    if(expand("%:p:h")!=getcwd())
        echohl WarningMsg | echo "Fail to make! This file is not in the current dir! Press redirect to the dir of this file."
    endif

    exec "w"
	call SetCompilation()
	exec "make"
	exec '!time ./%<'
	exec "copen"
endfunction

function SetCompilation()
    if &filetype=='c'    
        set makeprg=gcc\ %\ -o\ %<
    elseif &filetype=='cpp'
        set makeprg=g++\ %\ -o\ %<
    endif
endfunction

截取自我自己的.vimrc

具体从哪抄来的就不知道了,

效果:

智能座舱测试工程师必看:从零搭建自动化测试框架的5个实战技巧 本文为智能座舱测试工程师提供从零搭建自动化测试框架的5个实战技巧,涵盖环境搭建、ADB高级应用、Python脚本工程化、Monkey测试优化及性能调优。通过ADB深度操作和Python脚本封装,帮助测试人员构建高可复用的智能座舱测试解决方案,显著提升测试效率与问题发现率。 阅读详情

相关推荐

ROS2_IGH方案配置(二)——Ubuntu22.04 实时内核性能验证与调优

本文详细介绍了在Ubuntu22.04系统上配置ROS2_IGH方案时,如何验证和调优PREEMPT_RT实时内核性能。通过使用cyclictest工具进行基准测试和压力测试,分析中断与硬件延迟,并优化内核参数,确保系统满足工业控制领域对硬实时性的苛刻要求。文章还提供了针对ROS2的特殊优化建议和性能监控方案,帮助开发者实现毫秒级延迟的稳定控制。

weixin_30791095的博客 222

【Vim使用】6.quickfix使用及一键编译

在程序的开发过程中,很重要的一个循环是:编辑-编译-编辑,vim中的quickfix功能就是为了提高这一循环的效率。quickfix功能将编译过程中产生的错误信息保存到文件中,然后vim利用这些信息跳转到源文件的对应位置,我们就可以进行错误的修正,之后跳到下一个错误重复上述操作,从而极大地提高编译错误的修改效率。 在vim中除了文本编辑功能外,还可以直接地调用外部的编译器完成程序的编译工作,

TramiDu_Tech 2517

从URDF到Gazebo:一个完整的ROS2机械臂仿真项目实战与避坑指南

本文提供了一个完整的ROS2机械臂仿真项目实战指南,详细讲解了从URDF建模、ROS2 Control配置、MoveIt2集成到Gazebo仿真的全流程。文章重点分享了URDF惯性参数设置、Gazebo插件选择、MoveIt2配置修正等关键步骤的避坑经验,帮助开发者快速搭建可用的六轴机械臂仿真环境,实现从静态模型到物理仿真的跨越。

weixin_29279153的博客 273

vim QuickFix 窗口

From: http://hi.baidu.com/bali5/blog/item/82f87c0ab670a136b0351d4f.html 在上一节的图10中大家可以看到在窗口下面有一个显示查询结果的窗口, 这个窗口中列出了查询命令的查询结果, 用户可以从这个窗口中选择每个结果进行查看, 这个窗口叫"QuickFix"窗口, 以前也是一个vim的插件来的, 只不过现在成了vim的标准插件,

JoeBlackZQQ的专栏 1万+

企业级AI Agent平台建设方案

本报告将深入剖析构成一个顶级AI Agent平台的各个功能层面,为构建者提供一份全面的战略蓝图。

分享AI和大数据领域的知识和研究 1582

Android AMS——AMS初始化(二)

Android AMS 也是一个系统服务,属于系统服务中的引导服务,在 startBootstrapServices() 方法中启动。这里我们就来看一下 ActivityManagerService 的启动流程。

小旭的专栏 775

使用Vim打造IDE--quickfix窗口

是vim默认的插件。查看帮助文档::help  quickfix例如执行make,编译出错::make然后就会有错误信息在quickfix中显示。:cw可以进行quickfix的切换显示。下面的QuickFix窗口中我们可以找到每一个编译错误, 同样可以用鼠标点击每一条记录, 代码会马上自动跳转到错误处。你也可以用下面的命令来跳转: :cn        // 切换到下一个结果 :cp        // 切换到上一个结果如果你经常使用这两个命令, 你还可以给它们设定快捷键。比如在~/.vimrc中增加如

IterZebra 8193

使用Transformer实现自动调制识别(RML2018)

image_size = 1024 # resize重置输入大小patch_size = 16 # 从输入图片中将被提取的块大小# 分成 num_patches 个块num_patches = (image_size // patch_size) #(72/6)**2 横着裁剪),],return x})

QAQIknow的博客 1321

从零开始配置vim(28)——代码的编译、运行与调试

在前面几个章节,我们逐渐为Vim配置了语法高亮、代码的跳转和自动补全功能。现在的Vim已经可以作为代码编辑器来使用了。但是想将它作为日常发开的主力编辑器来用还需要很长一段路要走,其中一个就是要为它配置代码的一键编译与运行功能。这里我们仍然以C和Python为例。一个是需要编译运行的一个是直接就可以运行的,这两个语言应该能代表大多数语言的情况。

Masimaro的专栏 5189

【2026OD新机考】【哈希表】20260422-文章特征提取【Py/Java/C++/C/JS/Go六种语言OD真题】【欧弟算法】全网注释最详细分类最全的华子OD真题题解

90+天陪伴式学习,100+直播课时,300+动画图解视频,500+LeetCode经典题,500+华为OD真题/大厂真题,还有简历修改、模拟面试、陪伴小群、资深HR对接将为你解锁。这道题的本质是多集合交集问题的变形,属于非常典型的哈希表应用题。,储存全局的每个片段中,各个字符最少出现的次数。表示该字母并非所有片段的公共字母。,按照顺序构建答案即可。没有字母在所有三个字符串中都出现。每个字母在各字符串中都至少出现。次,所以结果中每个字母出现一次。这样,当上述循环结束后,最终。显然在上述代码中,如果字母。

weixin_48157259的博客 66

Freeswitch DTMF 按键无法接收问题修复

freeswitch 在接收到 update后,会更新成新的 payload type,但是给的200响应,仍然是旧的,这时候就会导致手机侧认识需要发送旧的payload,所以发到 fs 后就会导致直接丢包,不去处理RTP包了。呼叫时需要设置通道变量 rtp_manual_rtp_bugs=ACCEPT_ANY_PAYLOAD ,这时候FS 就不会对包的payload进行判断,直接判定通过。应该修复 freeswitch 给响应时,应该根据收到的 payload 发送给手机,但是一直未找到正确的路径。

2301_81507069的博客 373

vim quickfix——最灵活的quickfix

本文主要介绍 vim quickfix 的使用与优化。 什么是 quickfix quickfix 属于 vim 的高级功能,该功能在主流 IDE 或者编辑器中都有集成。 简单的说,quickfix 就是搜集编译器的输出信息,然后定位错误与警告位置,提供直接跳转功能。可以说有了完善的 quickfix 功能的 vim 编辑器才是真正的编辑器之神。 如何使用 quickfix 首先来了解一下 quickfix 的工作流程。 第一步,设定要执行的命令,也就是编译、运行程序的命令。可以在 vim 中通过命令设

niuiic的博客 6394

图神经网络实战(6)——使用PyTorch构建图神经网络

图数据集通常比简单的连接集合更加丰富,因为节点和边可以具有表示分数、颜色、单词等特征。包含这些额外信息在输入数据中对于生成最佳嵌入至关重要。在本节中,我们将使用 Cora 和 Facebook Page-Page 数据集,首先将它们视为表格数据集,观察香草神经网络在节点特征上的表现如何。然后,尝试在神经网络中加入拓扑信息,实现图神经网络 (Graph Neural Networks, GNN) 架构:一个同时考虑节点特征和边的简单模型。最后,我们将比较两种架构的性能。

盼小辉丶的博客 2万+

vim的quickfix模式

通常,我们在开发过程中,经常要写代码,编译,修改编译错误,这个过程会数十遍上百遍的重复。如果你是根据编译器输出的错误信息,打开出错的文件,找到出错的行,然后再开始修改,那效率未免太低下了。 利用vim的quickfix模式,可以大大加快这一过程,你可以在vim启动编译,然后vim会根据编译器输出的错误信息,自动跳到第一个出错的地方,让你进行修改;修改完后,使用一个快捷键,跳到下一个错误处,再进行

tycoon的专栏 1760

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Vim错误处理新姿势:用vim-qf实现编译错误一键定位与修复

在Vim编辑器中,处理编译错误和代码问题时,quickfix窗口是开发者的重要工具。然而,原生的quickfix功能使用体验并不理想,需要频繁切换窗口和手动操作。**vim-qf**(vim-quickfix的缩写)插件通过一系列增强功能,让错误定位与修复过程变得更高效、更流畅,成为Vim用户提升开发效率的必备工具。 ## 为什么需要vim-qf? Vim的quickfix和location

gitblog_00869的博客 308

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

vim:quickfix make

vi/vim使用进阶: quickfix   :help quickfix :help :make :help 'makeprg' :help 'errorformat' :help 'switchbuf' :help location-list :help grep :help :vimgrep :help :grep :help starstar-wildcard 以前读武侠小说,看...

hunter 653

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

quickfix-reflector.vim:实时编辑和更新代码中的quickfix列表

quickfix-reflector.vim:实时编辑和更新代码中的quickfix列表 项目介绍 quickfix-reflector.vim 是一个强大的Vim插件,它允许用户直接在quickfix窗口中编辑和删除条目,并将这些更改实时反映到对应的文件中。这个插件特别适合那些需要频繁地在quickfix列表和源代码之间进行切换的开发者。通过简单的编辑和保存操作,开发者可以快速修正代码中的错误,...

gitblog_00071的博客 809

vi/vim使用进阶: 剑不离手 – quickfix

vi/vim使用进阶: 剑不离手 – quickfix56 条回复返回vim使用进阶: 目录本节所用命令的帮助入口::help quickfix :help :make :help 'makeprg' :help 'errorformat' :help 'switchbuf' :help location-list :help grep :help :vimgrep :help :grep :he

922

Vim C/C++的一键编译

开始用Vim差不多有两个月的时间, 一开始用Makefile 编译一整个项目无压力, 但是当写到单个文件的时候, 编译就比较麻烦了, 每次都得 :w :!gcc -o 1.exe 1.c :!1 非常麻烦...所以我都直接用的Code::Blocks...其实比Vim快多了哈哈... 但是昨晚折腾病发作, 想好好来配置一下, 于是花了一个晚上...改了一个能看得过去的一键...

dingjin9321的博客 189

vim quickfix学习笔记

vim quickfix学习笔记常用命令按键映射设置功能键设置跳转设置自动编译并显示错误列表 常用命令 cc 显示详细错误信息( :help :cc ) cp 跳到上一个错误 ( :help :cp ) cn 跳到下一个错误 ( :help :cn ) cl 列出所有错误 ( :help :cl ) cw 如果有错误列表,则打开quickfix窗口 ( :help :cw ) col 到前一个旧的错误列表 ( :help :col ) cnew 到后一个较新的错误列表 ( :help :cnew ) 按

雪夜的博客 334

foobox-cn 实战:3 步把 foobar2000 换成现代三栏界面

想让 foobar2000 换成现代界面又不想换播放器,foobox-cn 解决的就是这个问题——它是一套 foobar2000 默认用户界面(DUI)的中文皮肤配置包,装上后获得深色/浅色双主题、多播放列表管理、封面浏览与歌词显示,布局还能一键切换。本文带你完成安装、首次布局切换和几个常用设置,看完即可把播放器换成三栏现代界面并日常使用。 [![foobox-cn 深色主题下的 foobar2

gitblog_00738的博客 445

如何在Vim中使用内置的Make命令来编译程序?

你可以通过在Vim中设置makeprg变量来自定义make这将设置Vim使用gcc编译器,并为每个源文件生成一个可执行文件。

2401_85761762的博客 1406

VIM使用系列:quickfix功能

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34209851的博客 641

Wan2.2-S2V-14B 音频驱动视频生成本地部署速通教程

Wan2.2-S2V-14B 是一个音频驱动的视频生成模型:给它一张人物参考图、一段说话或唱歌的音频,它会生成口型、动作与音频对齐的电影感视频。本文按"Wan2.2-S2V-14B 部署教程"的思路,带你从零跑通本地推理,适合拥有 N 卡、想在自己机器上生成口播/演唱视频的普通用户。 ## 项目速览 - **输入三件套**:参考图像 + 驱动音频 + 可选文本提示词,输出 480P 或 720

gitblog_00563的博客 967

Neovim编译系统详解:一键编译运行C/C++/Rust代码

你是否厌倦了在终端和编辑器之间来回切换,只为编译运行代码?这款Neovim配置提供了完整的编译系统解决方案,让你在编辑器内就能轻松编译和运行C、C++、Rust等多种编程语言的代码。通过智能的编译配置和便捷的快捷键,你可以专注于代码编写,而无需离开编辑器环境。 ## 🚀 一键编译运行的核心功能 这个Neovim配置内置了强大的编译系统,通过[lua/private/compile.lua](

gitblog_00042的博客 890
上一篇: 工具:在VIM中添加一键编译和一键运行
下一篇: 搬砖:算法经典面试题
nedwons
博客等级 码龄9年 311粉丝 572原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值